Advanced encoder management

Currently the encoder selection is just utterly stupid and just picks a single one. As a result there is a lot of magic going on inside the encoders themselves (TightVNC is the worst, but ZRLE also has a lot of this "sub-encoding" silliness).

Move everything up a layer so that we can share that logic for every encoder. This also means that we can mix encodings in a single update, allowing us to pick the best encoder for each rect.

This first version basically just copies the logic from the Tight encoder. Will have to analyse things to see how we should improve things going forward.