Moved everything to namespaces for PSR-0 compliance; moved global functions to separate class; moved Exceptions into their own directory; tidied up unit tests
Finished refactoring unit tests to namespaces