Added type remapping.
Updated the Java example
Various fixes in the type remapping.