JS-Frontend: Added namespaces to functions and refactored to CamelCase

Ported patch #2158 to master including namespaces for frontend JS and CamelCasing. This time I separated the CamelCase patch as I don't know wether that follows your style guidelines.