Refactor and merge apps/topology to trema.