Move queue_action to a protocol

* Easier to test the client this way.

Commit references #38.