added the class PrologEngineModel and using it in most places where PrologEngine was before. The code needs an urgent cleanup.