Refactor to -api and -core modules, to reduce the potential for a runtime dependency cycle between core and the various transports.