Format code to follow PHP-FIG PSR-1/2

This is just a whitespace reformat of the code so that it follows the PSR-1 and PSR-2 standards. There shouldn't be any change in functionality. Most of the changes were done by https://github.com/fabpot/PHP-CS-Fixer and then a few extra changes were made manually.

As this PR stands, it should be applied after #5 since it also includes the updates to the nested arrays.