Simplify globals and namespaces

*In progress.*