Moved classes into namespaces and added autoloading.