Added rule body reordering for safety

Previously, we assumed the user would order rule bodies to ensure
that negative literals always occurred after all their vars were
bound.

This change moves all the negative literals to the end of each rule.
It is not even smart enough to check whether there is a need to
change the ordering.  Will need to be revised once performance becomes
an issue.

Change-Id: Idae20e23abc70307fcfba5d11b1a5958d4ab05bc