javascript module for doing the module magic dance