Refactor harness.pir a bit, but it is still a gnarly beast