Made globals into factories for better minification and because globals are lame