Order setImmediate calls before setTimeout calls

Fixes #595