Break out modules and add rpc interface for master-client