minor refactorings in the JRef class and friends
added support for serializing Java objects as Prolog terms (a bit on the style of InterProlog)