add case assignment functions and tests
Merge pull request #1734 from dimagi/reassign-subcases

add case assignment functions and tests