JavaScript: Base module pattern