Modifications to module subsystem.  Add unit tests.