using a channel to queue pending tasks. cleanup up the tests a bit.