Needs more RAII.
Formatting change.
Started major refactor of scheduler. Everything is broken.