engine resource scheduling, redux

This is the latest incarnation of #649 and #657 - it proved almost impossible
to rebase those onto master, so this involves a merge instead.
Not implemented yet.