Prettified all the PHP files

This code was seriously fucked up, so to be able to work with it at all I've run
a bunch of scripts on it. The indentation has been fixed, and converted
to 4 spaces everywhere. PHP-CS-Fixer has made the coding standard just a tiny bit
less horrible.