Module system rewrite to support modules-as-classes. Only the two core modules rewritten so far until the interface is finalized