add javaBackendHooks method to AbstractKModule + clean up BuiltinFunctio...

...n code

**do not review yet**
I'm not that worried about this detail.

My main concern is being able to take snapshots of the entire state. It would be very hard to achieve with this rewriter anyhow, as it does destructive updates. It may work if we have a good cloning mechanism for everything. Do we?