Restored main tests and cleaned up comments/debugger/dead code