Replaced synchronize's with ReentrantReadWriteLock

This should be functionally the same as all of the synchronize
statements, except read operations will not block each other. This gives
us huge performance benefits for things like contains() and get() when
under heavy load.