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

Very limited as yet and the only one we use is 'unknown'
Make false/0 fail, and add last/2 as a bonus

It a naive implementation of last/2 using append/3.