Added tests and cleaned up namespaces