Move image encoding logic into a central EncodeManager class

This allows us to apply a lot more server logic
independently of which encoder is in use.

Most of this class are things moved over from the
Tight encoder.
String literals are constant
Merge branch 'encodemanager' of https://github.com/CendioOssman/tigervnc