breaking things up into more logical units, adding tests and building out needed primitives to preserve keytable and drive hive