Break apart engine and cli into separate modules.