Continued fixing things across various classes to make them work with
our new core classes. I've also cleaned up indentation and random code
snippets along the way.
Replaced several core classes from DD with new classes to enforce
integrity checks. Rewriting everything that depended on those classes is
a massive undertaking but it should simplify our code and prevent the
many bugs we've seen lately. The rewrite isn't done yet, just committing
my progress so far.