Work done on debugging native code.
Basic mappings are now working.

Replaced a lot of native code; I gave up on caching JNI stuff.
Checking parameters, more tests.