Removed unnecessary PHP close tags.
Fixed some incorrect PHPDocs and unused variables.
Follow PSR-1 and PSR-2 coding style.
Also apply PSR-1 and PSR-2 to tests directory.
Merge pull request #94 from RickWong/master

Clean up and applied PSR-1 & PSR-2 coding standards.