Add Composer.json and namespaces to the classes

Please take a look at the attached code. I've added a composer file, which makes it possible to place the library on Packagist.

Aside of that, I also separated all classes and made one file per class. At top of the classes there now is a namespace.

Most of the code styling has been optimized for psr-0. None of the functions itself has been changed, this just makes it better maintainable.