Ported to coffescript. Removed controllers as globals.