Cleaned up imports in graphs.py. Added missing imports in graphs_test.

However, the current error is that it cannot find module errors from graphs.