Simplify scheduler

Remove unnecessary bookkeeping, use fast insert instead of splice, introduce a real Task object