Use an array for tasks instead of a list.

There are no reasons to use a list as a queue instead of an array. It's [slower](http://jsperf.com/apif4948fhfpshde#table) and requires more code and memory (each node).