Added priority queue to help make sure messages aren't overwritten.

Known issue: checking the queue only happens on new lines from the server,
not continuously. Perhaps I should make it a thread?