Add requirements based scheduling.

See #367.