Fix some CS glitches, add missing phpdocs etc.