Minimize globals

This begins the process of moving variables and functions out of the global namespace. The next step would be inspecting the 'globals' object and thinking through cohesive functionality that could form its own proper object.