Re-submission of CachedThreadScheduler, implementing #1140

Merged in the latest from the master branch and refactored some internals in CachedThreadScheduler to better match the latest ```Scheduler``` changes.