Fix for bug in CHTreap

There's a bug in CHTreap where adding the same object with a lower priority corrupts the tree. This pull should fix it; I added a test case that demonstrates the issue and the fix.