function scheduleTask(handler, blocked) {
        var task = new Task(handler, blocked);
        tasks.push(task);
        return task;
    }
Schedules a task for future execution. The given handler will execute
immediately after all previous tasks upon frame flush, unless this
task is blocked. If any tasks is blocked, the entire frame will not
render (and no tasks within will execute) until all tasks are unblocked.

@private
@param {function} handler The function to call when possible, if any.
@param {boolean} blocked Whether the task should start blocked.
@returns {Task} The Task created and added to the queue for future
                running.