Added wrapper for MaxFlow and implemented memory benchmark.
Refactoring.