Add some tests for the dispatch thread.

Not yet fully complete.
Merge pull request #66 from unknownbrackets/scheduling

Add some tests for the dispatch thread