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.