Fix coding standards

This fixes the coding standards in the library using the PHP-CS-Fixer (I haven't done any manual change for that, only the automated ones).
~~This PR is built on top of #147 to avoid conflicts.~~ Rebased now that the other PR is merged