Overhauled problem solver's restart system

Also added existing/2 and hacked primitive actions to declare the
existence of their patients as preconditions.
Improved loop detection in problem solver
Merge pull request #3 from ianhorswill/master

Updates