Get rid of some awful switch constructs, tighten comments, move stuff around
Get rid of needlessly public interfaces in queue.js, tighten up bits and bobs
More generaly tidying of code and comments