Proper checking of logging level before formatting. Avoids usless
calculations.
Use PrologImplementation not PrologReferenceImplementation
finalBindingsToInitialVar()
Fix warnings, add comments.