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.
diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h
index 6adeac2..fd1897a 100644
--- a/common/rfb/VNCSConnectionST.h
+++ b/common/rfb/VNCSConnectionST.h
@@ -32,11 +32,11 @@
 #include <rfb/SMsgWriter.h>
 #include <rfb/VNCServerST.h>
 #include <rfb/Timer.h>
+#include <rfb/EncodeManager.h>
 
 struct RTTInfo;
 
 namespace rfb {
-  class Encoder;
 
   class VNCSConnectionST : public SConnection,
                            public Timer::Callback {
@@ -197,7 +197,7 @@
     Rect renderedCursorRect;
     bool continuousUpdates;
     Region cuRegion;
-    Encoder* encoders[encodingMax+1];
+    EncodeManager encodeManager;
 
     Timer updateTimer;