Replace JobQueue with JobStack

This makes UI quite a bit more responsive when panning gets ahead of the worker pool. Also enabled optimizer for G++, and a bit of cleanup.