better tests and refactoring how locations get added to forms

codependent on https://github.com/dimagi/casexml/pull/48