Moved ID locks implementation to RBTree

Previous hash-based implementation had collisions which lead to dead locks
Merge pull request #101 from euroelessar/master

Moved ID locks implementation to RBTree