Move graph plotting to a separate library, pt 2