move globals to an atom plus other formatting modifications

Previously, the globals were stored in a ref which was updated using a fn which tool @globals as a param which isn't thread-safe. Also, given that globals doesn't need to be coordinated with anything else, it's better to store it in a simple atom. I wrapped the declaration of globals in a defonce so multiple evaluations of the ns wouldn't clobber the atom. Finally I removed the use of a `def` within a `defn` which isn't considered very idiomatic. 

Let me know what you think :-)