switching to requireJS, managing dependencies, trying to get rid of all the global static variables