test_plot_implicit: Cleanup the figures created after the tests are over

I also refactored the existing code for the utility classes/functions
used in the tests into a separate module.
I think he means, "Since you run this only if matplotlib, what error do you expect?" Shouldn't you have just the plot_and_save followed by the cleanup?