Cleaned up module and worker construction

Made separate files for ModuleRegistry and ModuleHolder. Cleaned up
arguments passed when creating modules and workers.