Add support for validity set by callback function.

Bumps version to 0.2.

See #1.