MinMaxElementsValidation performs a useful role as a template for
how we can create simple subtree validations. Split the common bits
into AbstractValidation and elinate code duplication by doing some
trickery.
JIRA: YANGTOOLS-1177
Change-Id: I5adbed16e85f9752a0ce5061b0159c8124583346 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>