Switch from std::priority_queue to std::vector in message_loop

Use a mixture of std::vector and std::*_heap algorithms instead of
std::priority_queue which has issues with movable-only types.

Fixes #21