Implemented a task queue.

Enables queing of Tasks and MicroTasks.