Rewrote Namespace functions to be a lot more logical. Still need to write tests.