Java builtin (user-level) substitution

This push request contains an implementation of an user-level substitution mechanism for the Java backend.

Note however that it cannot be used directly instead of the one used in substitution.k because the java engine cannot process that file (and those depending on it).  

I have something written to address that in a separate branch (see  aeff8a8afa9ebf3dc4316d972b3a55a9308f9101 );  however, I would like to push this first as the substitution works and I have a provided a regression test for it.
Okay, that makes sense. I have made an issue and assigned it to me, I will
try to get to it sometime this week. This is fine for now. If you fix the
minor issues and answer my question, you can merge, Traian.