implemented betweenness and closeness

some cleanups and architecture improvements still to come