Current scheduler and I/O work

This rolls up me previous, unmerged pull request along with the last week's work. There is a lot of miscellaneous stuff here. Most of the issues that prevented the last pull from merging are resolved, but there is still a somewhat rare deadlock on mac that I'm hoping won't be too obnoxious.