ClassifiedRegion: improve class array generation

Instead of always re-populating the array each time it's requested, it
makes more sense to initialize lazily and reset the array if a new
class is added.
Fusion: refactor multithreaded fusion

This resolves significant performance issues with the multithreaded
fusion operation.

There were two problems: work was being split up by tile, and
cursor.setposition was called for each pixel.

When splitting work by tile, you may have 2 tiles with 10k pixels and 2
tiles with 100 pixels, and your threads will end up with significantly
different loads - which is undesirable.

Now, we split up work based on indices within the largest dimension.
This maximizes the chance for work to be evenly distributed across a
large number of threads.

For the actual per-pixel work, we now match as closely as possible the
operations of the old stitching algorithm. SetPosition is just called
once at the start of each loop, per dimension, to jump to the correct
starting area.
Fusion: apply processing improvements to writeTile

Since there are, unfortunately, currently still two tile processing
methods, we need to transfer the per-pixel speed improvements to the
writeTile method as well.