Added a priority queue data structure for the runtime

This is a priority queue implemented using a binary heap stored in
an array. The priority queue will be used to implement wakeup events
or other types of events in the runtime.