add a version check for the json output and remove some whitespace
don't close PHP files, its bad practice
some PSR updates and readability updates etc.
Merge pull request #30 from djekl/master

Various updates around version checking and PSR style guide