basic validation + phpunit test 
changes pulled from lwmm, who added the validations and the unit tests
work in progress
work in progress