CS fixes

Lots of CS fixes like 
- better code formatting
- more PHPDocs

Huge thanks goes to @Spomky

This PR is replacement of #50 as I had few problems with pushing to original PRs branch.