Cleaning spree

- Fixed a lot of typos
- Fixed some bugs
- Fixed some tests
- PSR-2 reformatting
- Made some things more IDE Friendly and fixed some errors in the PHPDocs