don't use deprecated Assert class
introduce a new "max" attribute that allows to specify the maximum number of times a token may appear
whitespace/linebreak cleanup only
support for "min" attribute - supports only 0 or 1 for now