Added call to get/set module state from test module.
Added registration of module-state database model.
Added startup/shutdown/restart functionality.