Fix calls to callback functions
Create global references

when instantiating in the native code new objects that are used in the Java code,
the jobject variables need to be globally referenced.
Fix jmsghdr and formatr class names