Bug fixes and doppelgangers

Fixed some embarrassing datatable layout bugs, removed a bunch of dead code and threw in domain doppelgangers feature too.