Changes to remove dependency on internal queue and improve performance,
reduce number of objects created, reduce GC overhead, and fix bugs in
priority internal queue