Added validation code from __setattr__ back in as validate() and
refactored to make it check all attributes at once. Added unittests for
__setattr__ back in (with the calls to .validate() added)