API improvements, moved JNI messages to callbacks