Merge of new validator with tests

Per @gvwilson request (issue #34).