organizing javascript files, adding namespaces and modularizing some settings