Modularized the plot generation

And it works splendidly now. Except for the text, fuck the text.