Add new baseQueue and underlying priority queue code and tests.

baseQueue will be embedded in all range queue implementations.
Do we never want to allow situations in which ranges get put in a queue triggered through an event? That would suggest going for thread safety here.