This finally allows the test harness to cleanly shut down. Awesome! This commit also reformats the whole project's native code. Oops!