C topology

Refactor and merge apps/topology.

This pull request depend on #258.