Small refactorings

Mostly small changes to phpdoc and syntax. Also collapsing some whitespace and fixing full classnames.

There is also some changes that is just a habit of mine. Most commits should be atomic and therefor easily reversible.

Hopefully i didnt break anything, trusted the current testsuite and since it passes i think it should be allright.