add rebuild function to cases + simple tests
Merge pull request #23 from dimagi/case-rebuild

add rebuild function to cases + simple tests