Fix some phpdoc blocks
Code reformat to PSR1/PSR2 standard
Add some doc blocks and fix spellings