extract base module class
Merge pull request #1885 from dimagi/modulebase

extract base module class