Allowing the `required` rule to take a parameter.

This parameter (`isRequired`) can be a boolean or a function. If it is
a boolean then if it is true the field is required and if it is false it
isn't. If a function is passed then this function is called every
time the field is validated and should return a boolean (true if the
field is required, false if it isn't).

As you can see from the code in the previous commits, I incorrectly
assumed this was the original behaviour of the rule. Now my "Secret
Ninja Word" seems to validate as I would expect.

There is still a bit of weirdness because of the `wasFocused` property
on the textfield (if you show and hide the text field it stops
validating on change even when you might expect it to) but I am OK with
that for now.
Added some new tests testing the "required rule with function param"