Moving some topo code into a small library.