all dependencies on the order in which JS files are loaded removed; state-dependent code now in init functions (should fix deployment issues)