Full PSR-1 Compliance (Most of PSR-2)

There are a few annoying tweaks left to be made regarding spacing between lines etc which I don't see the point in enforcing harshly. As long as the actual code flow and structure is correct then that's the main thing.