added an explicit Functor class
added support for full term unification in the Java side.