added composer.json and fix phpdocs and cleanup formatting

* code is now formatted as per http://www.php-fig.org/psr/psr-2/
* added missing phpdoc tags
* added composer.json