move new_module function to Module class
Merge pull request #1743 from dimagi/new-module

move new_module function to Module class