Implemented a simple non-blocking queue.

Blocking features will be added in separate commit.