Cleaning up a VisitDomainWrapper method to work if visit.encounters are out of order, and moving its tests from the EMR module to EMR API