Fix PHP_CodeSniffer errors and code beautify with php-cs-fixer

This is really huge commit that make the source code PSR-2.
I fixed all errors generated with:
$ phpcs --standard=PSR2  --encoding=utf-8 Library/
And also I run the command:
$ php-cs-fixer fix --level=all Library/