finish cleanup and add support for gnuplot graphics, python rewrite should now be completed