Improve handling of prolog flags

Now only define flags, their values and if they are settable in one
place.