validate case index domains
fix existing test case
add index ref domain test case
use cached casedb to get cases
use domain checking in CachedCaseDb
Merge pull request #231 from dimagi/validateindex

validate case index domains