Message queue clear

Implements a clear function for message queues and custom cleanup handers for input and update message queues.