JavaScript modern module pattern