JNI Wrapper: Some more code refactoring + added macros for JNI function name generation.
JNI Wrapper: Improved error handling code (again!).