Made php files comply to PSR-1/2 where relevant.
other misc changes to editor/templates