Rebuilt from the ground up. Much cleaner code thanks to jgit and
Titanium. Investigating now to see if this models everything
correctly.