Added chaining support to the autoloader
Added a number of phpunit test
Some minor bug fixes and small refactors