Java FFI: support inner classes and use of JavaObject across the FFI

Minor incremental improvements to the Java FFI