Write unit test for JNI, move to non-android-specific, and fix cleanup issue with JNI.