Refactor graph manipulation functions as pure functions in the services module

This is a pretty major change; app no longer depends on debtgraph as an external library,
I am refactoring the graph building and manipulation functions in the services module
of the app. This was motivated by a major change to the way the graph building algorithm
works. It now is able to reliably produce the most sane graph for a variety of transaction
lists.