Refactor MessageQueue as an io service