Fix bug with temps overriding temps

There were some bugs in segment util surrounding temps overriding temps.  This change introduces a unit tests to help cover those cases and the fix.

There are a lot of changes to the test fixtures because there were events in there with duplicate ids and the system no likee duplicate ids.

@jebeck please check and merge when possible.