Factored out libraries borrowed from other Prologs. Also I commented
out the justification section as this is not being maintained, and we arguably have better debugging methods now.
Authored by: tswift 2016-01-03
Parent: [r8559]
Child: [r8561]