Changed the module interface, added three sub-modules (emit, on, factory)