Improve maximum flow and minimum cut tests.

Added a validate_cut function that also validates the minimum cut, also added a class for testing the interface to maximum_flow and minimum_cut, we should add more tests here. Moved the tests especific to one algorithm outside the class for common tests.