Module based support

Merged module support into master