More refactoring.

Recursive functors now! *gasp*
Add the beginnig of graph export.