Edits to bring it in line with PSR2 coding standard
Makes some edits to bring files into line with PSR2

Using `phpcs --standard=PSR2` to find out problems
Makes more edits to bring the test files into PSR2