fix bug in rebuild_case and add test that would have caught it
Merge pull request #82 from dimagi/cz

fix bug in rebuild_case and add test that would have caught it