update it so that archiving a form forces sync of those cases to phones

http://manage.dimagi.com/default.asp?110307

This is done by adding a system action to the case history representing
the rebuild.

also added and updated tests for this