Make shell print errors as prolog terms
Add handling of prolog flags

Very limited as yet and the only one we use is 'unknown'
Merge latest from robert