Added unit tests

Changed source to conform to Zend coding standards