Queue scheduler

This scheduler may have its own set of issues. I plan to rewrite it again, but for now it works nicely with timers etc.