Module pattern with a special loader which provides multiple isolated instances, shared private state, and automatic initialization of submodules