Issue #27: moved some debug printing to DebugTools
Issue #7: rewrote some stuff from swift back to Obj-C, since can't seem to call swift code (main target) from Objective C code (test target)