Lots of stuff.
Separated from GUI code, re-written DAG.