Move graphing functionality to a separate module. Bugs ahoy!