javascript: minimize global objects (module pattern)