added namespace
added init.php
refactored code from sample into transport classes
validate() returns array of errors