[WIP] Updated code to be PSR-1 and PSR-2 compliant

Update was done usng the "php-cs-fixer" program, with manual checks afterwords.