New queue and input interrupt

Change message queue into more generic message queue. Add handling of
external interruption

Signed-off-by: darkenk <darkenk@gmail.com>