added support for isBuiltin and isToken in the java rewrite engine
added hook for mod operation in the java backend
minor refactoring