Added a replication test and nuked a bunch of misguided code (as usual). Figured out that I need to model xh semantics at a much lower level.