Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs	(revision 13386)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs	(revision 13387)
@@ -26,4 +26,5 @@
 using Google.ProtocolBuffers;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Drawing;
 
 namespace HeuristicLab.Persistence {
@@ -39,63 +40,81 @@
 
     internal StaticCache() {
-      Initialize();
+      guid2Transformer = new Dictionary<Guid, ITransformer>();
+      transformer2Guid = new Dictionary<ITransformer, Guid>();
+      guid2Type = new Dictionary<Guid, Type>();
+      type2Guid = new Dictionary<Type, Guid>();
+      typeInfos = new Dictionary<Type, TypeInfo>();
+      extensionRegistry = ExtensionRegistry.CreateInstance();
+
+      foreach (var transformer in ApplicationManager.Manager.GetInstances<ITransformer>().OrderBy(x => x.Priority))
+        RegisterTransformer(transformer);
+
+      RegisterType(new Guid("94AD8522-3F55-4580-A6F8-2D2AAEDD4B8C"), typeof(bool));
+      RegisterType(new Guid("4A1C0FD5-423D-4F96-AB22-A496578C25AC"), typeof(byte));
+      RegisterType(new Guid("C4B00F0B-FED7-439F-B1B2-8A0048B64882"), typeof(sbyte));
+      RegisterType(new Guid("9F451811-3DE1-43AB-8B74-D7E03851857B"), typeof(short));
+      RegisterType(new Guid("46244D54-0145-49F7-9CF3-9CDB7FB5F240"), typeof(ushort));
+      RegisterType(new Guid("1FDDE40C-09E3-491F-8FBB-32BB3C885E9E"), typeof(char));
+      RegisterType(new Guid("EE3E0F9C-A5C2-4461-AF36-28BD8F26E6FB"), typeof(int));
+      RegisterType(new Guid("69476D18-D285-43E9-BC7C-6CC9E9F2321E"), typeof(uint));
+      RegisterType(new Guid("7C7BC5EC-F001-4BA0-9F85-50DCBAA9AE81"), typeof(long));
+      RegisterType(new Guid("AC808D5A-63BB-457C-9B92-C9B83DA2B139"), typeof(ulong));
+      RegisterType(new Guid("BF22653A-026C-4367-BBBA-2125AECF6C08"), typeof(float));
+      RegisterType(new Guid("8B49821A-3ADC-4715-9DB1-08E2F3CFDF15"), typeof(double));
+      RegisterType(new Guid("7BB386BF-6FD4-443D-A6C1-387096798C67"), typeof(DateTime));
+      RegisterType(new Guid("724A2D49-7E7B-455B-BBA9-4214C64E8A21"), typeof(TimeSpan));
+      RegisterType(new Guid("4DB2ED2B-D9F2-4695-B555-A2CF42740740"), typeof(Color));
+      RegisterType(new Guid("9BC74087-D5C0-4C39-99B4-D7465F478492"), typeof(Point));
+      RegisterType(new Guid("E84C326A-7E14-4F28-AEFF-BC16CC671655"), typeof(KeyValuePair<,>));
+      RegisterType(new Guid("F0280B55-25E8-4981-B309-D675D081402A"), typeof(string));
+      // Enum?
+      RegisterType(new Guid("859B7E34-3A07-41A3-AE93-79DCE5A1DB2C"), typeof(Type));
+      RegisterType(new Guid("D15AD28B-203A-460E-815C-F7230C4B1F75"), typeof(bool[]));
+      RegisterType(new Guid("EE318DC4-580D-4DB1-9AAD-988B0E50A3DB"), typeof(byte[]));
+      RegisterType(new Guid("326B9484-361F-46F8-B8A6-46C781A8C51F"), typeof(sbyte[]));
+      RegisterType(new Guid("C854783D-4C91-43C8-A19A-F96012494F8A"), typeof(short[]));
+      RegisterType(new Guid("C47FB329-2A1D-4EB7-AFB1-1CF72AB30E98"), typeof(ushort[]));
+      RegisterType(new Guid("9681D044-B50C-4907-B23E-BDFEBC6C3FFC"), typeof(char[]));
+      RegisterType(new Guid("0FC62D91-D63F-4507-8696-885D4C07285A"), typeof(int[]));
+      RegisterType(new Guid("C43A25A0-9B99-4DA4-9279-7495FE10428E"), typeof(uint[]));
+      RegisterType(new Guid("7AC4DDAC-0E13-428E-BF49-7BE7B76746CB"), typeof(long[]));
+      RegisterType(new Guid("8D9283A7-FE49-4AEA-A09F-D53CF3BE520A"), typeof(ulong[]));
+      RegisterType(new Guid("BB9CFA0B-DD29-4C44-85C6-3A6289C55448"), typeof(float[]));
+      RegisterType(new Guid("3B3AA69E-1641-4202-AE1D-7EEFF60FA355"), typeof(double[]));
+      RegisterType(new Guid("7DF325A6-2553-4915-B7C6-D98191107CB7"), typeof(string[]));
+      foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
+        foreach (var t in asm.GetTypes().Where(x => StorableClassAttribute.IsStorableClass(x)))
+          RegisterType(StorableClassAttribute.GetStorableClassAttribute(t).Guid, t);
+      }
+
+      RegisterExtension(BoolBox.Bool);
+      RegisterExtension(IntBox.Int);
+      RegisterExtension(LongBox.Long);
+      RegisterExtension(UnsignedIntBox.UnsignedInt);
+      RegisterExtension(UnsignedLongBox.UnsignedLong);
+      RegisterExtension(FloatBox.Float);
+      RegisterExtension(DoubleBox.Double);
+      RegisterExtension(StringBox.String);
+      RegisterExtension(BytesBox.Bytes);
+      RegisterExtension(BoolArrayBox.BoolArray);
+      RegisterExtension(IntArrayBox.IntArray);
+      RegisterExtension(LongArrayBox.LongArray);
+      RegisterExtension(UnsignedIntArrayBox.UnsignedIntArray);
+      RegisterExtension(UnsignedLongArrayBox.UnsignedLongArray);
+      RegisterExtension(FloatArrayBox.FloatArray);
+      RegisterExtension(DoubleArrayBox.DoubleArray);
+      RegisterExtension(StringArrayBox.StringArray);
+      RegisterExtension(MatrixBox.Matrix);
+      RegisterExtension(BoolMatrixBox.BoolMatrix);
+      RegisterExtension(IntMatrixBox.IntMatrix);
+      RegisterExtension(DictionaryBox.Dictionary);
     }
-    public void Initialize() {
+
+    public void RegisterTransformer(ITransformer transformer) {
       lock (locker) {
-        guid2Transformer = new Dictionary<Guid, ITransformer>();
-        transformer2Guid = new Dictionary<ITransformer, Guid>();
-        guid2Type = new Dictionary<Guid, Type>();
-        type2Guid = new Dictionary<Type, Guid>();
-        typeInfos = new Dictionary<Type, TypeInfo>();
-        extensionRegistry = ExtensionRegistry.CreateInstance();
-
-        foreach (var transformer in ApplicationManager.Manager.GetInstances<ITransformer>().OrderBy(x => x.Priority)) {
-          guid2Transformer.Add(transformer.Guid, transformer);
-          transformer2Guid.Add(transformer, transformer.Guid);
-        }
-
-        RegisterType(new Guid("94AD8522-3F55-4580-A6F8-2D2AAEDD4B8C"), typeof(bool));
-        RegisterType(new Guid("4A1C0FD5-423D-4F96-AB22-A496578C25AC"), typeof(byte));
-        RegisterType(new Guid("C4B00F0B-FED7-439F-B1B2-8A0048B64882"), typeof(sbyte));
-        RegisterType(new Guid("9F451811-3DE1-43AB-8B74-D7E03851857B"), typeof(short));
-        RegisterType(new Guid("46244D54-0145-49F7-9CF3-9CDB7FB5F240"), typeof(ushort));
-        RegisterType(new Guid("1FDDE40C-09E3-491F-8FBB-32BB3C885E9E"), typeof(char));
-        RegisterType(new Guid("EE3E0F9C-A5C2-4461-AF36-28BD8F26E6FB"), typeof(int));
-        RegisterType(new Guid("69476D18-D285-43E9-BC7C-6CC9E9F2321E"), typeof(uint));
-        RegisterType(new Guid("7C7BC5EC-F001-4BA0-9F85-50DCBAA9AE81"), typeof(long));
-        RegisterType(new Guid("AC808D5A-63BB-457C-9B92-C9B83DA2B139"), typeof(ulong));
-        RegisterType(new Guid("BF22653A-026C-4367-BBBA-2125AECF6C08"), typeof(float));
-        RegisterType(new Guid("8B49821A-3ADC-4715-9DB1-08E2F3CFDF15"), typeof(double));
-        RegisterType(new Guid("7BB386BF-6FD4-443D-A6C1-387096798C67"), typeof(DateTime));
-        RegisterType(new Guid("724A2D49-7E7B-455B-BBA9-4214C64E8A21"), typeof(TimeSpan));
-        foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
-          foreach (var t in asm.GetTypes().Where(x => StorableClassAttribute.IsStorableClass(x)))
-            RegisterType(StorableClassAttribute.GetStorableClassAttribute(t).Guid, t);
-        }
-
-        RegisterExtension(BoolBox.Bool);
-        RegisterExtension(IntBox.Int);
-        RegisterExtension(LongBox.Long);
-        RegisterExtension(UnsignedIntBox.UnsignedInt);
-        RegisterExtension(UnsignedLongBox.UnsignedLong);
-        RegisterExtension(FloatBox.Float);
-        RegisterExtension(DoubleBox.Double);
-        RegisterExtension(StringBox.String);
-        RegisterExtension(BytesBox.Bytes);
-        RegisterExtension(BoolArrayBox.BoolArray);
-        RegisterExtension(IntArrayBox.IntArray);
-        RegisterExtension(LongArrayBox.LongArray);
-        RegisterExtension(UnsignedIntArrayBox.UnsignedIntArray);
-        RegisterExtension(UnsignedLongArrayBox.UnsignedLongArray);
-        RegisterExtension(FloatArrayBox.FloatArray);
-        RegisterExtension(DoubleArrayBox.DoubleArray);
-        RegisterExtension(StringArrayBox.StringArray);
-        RegisterExtension(MatrixBox.Matrix);
-        RegisterExtension(BoolMatrixBox.BoolMatrix);
-        RegisterExtension(IntMatrixBox.IntMatrix);
-        RegisterExtension(DictionaryBox.Dictionary);
+        guid2Transformer.Add(transformer.Guid, transformer);
+        transformer2Guid.Add(transformer, transformer.Guid);
       }
     }
-
     public void RegisterType(Guid guid, Type type) {
       lock (locker) {
@@ -105,5 +124,7 @@
     }
     public void RegisterExtension<TExtension>(GeneratedExtensionBase<TExtension> extension) {
-      extensionRegistry.Add(extension);
+      lock (locker) {
+        extensionRegistry.Add(extension);
+      }
     }
 
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs	(revision 13386)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/Transformers.cs	(revision 13387)
@@ -329,5 +329,5 @@
   }
 
-  [Transformer("BA55C7A6-C91E-4351-A889-E4A7E647F16D", 213)]
+  [Transformer("BA55C7A6-C91E-4351-A889-E4A7E647F16D", 212)]
   internal sealed class DateTimeTransformer : LongBoxTransformer<DateTime> {
     protected override long ToBoxType(DateTime value, Mapper mapper) { return value.Ticks; }
@@ -335,18 +335,44 @@
   }
 
-  [Transformer("0C91441B-2D97-432B-B493-D6EC483FC5AD", 214)]
+  [Transformer("0C91441B-2D97-432B-B493-D6EC483FC5AD", 213)]
   internal sealed class TimeSpanTransformer : LongBoxTransformer<TimeSpan> {
     protected override long ToBoxType(TimeSpan value, Mapper mapper) { return value.Ticks; }
     protected override TimeSpan ToValueType(long value, Type type, Mapper mapper) { return new TimeSpan(value); }
   }
-  [Transformer("0B540EAC-79AB-40CF-8277-D2C81135FEB6", 217)]
+
+  [Transformer("0B540EAC-79AB-40CF-8277-D2C81135FEB6", 214)]
   internal sealed class ColorTransformers : IntBoxTransformer<Color> {
     protected override int ToBoxType(Color value, Mapper mapper) { return value.ToArgb(); }
     protected override Color ToValueType(int value, Type type, Mapper mapper) { return Color.FromArgb(value); }
   }
+
+  [Transformer("2E6D4A40-B4BE-425F-8E35-2D7C00054639", 215)]
+  internal sealed class PointTransformer : IntArrayBoxTransformer<Point> {
+    protected override IEnumerable<int> ToBoxType(Point value, Mapper mapper) { return new int[] { value.X, value.Y }; }
+    protected override Point ToValueType(IEnumerable<int> value, Type type, Mapper mapper) { return new Point(value.ElementAt(0), value.ElementAt(1)); }
+  }
+
+  [Transformer("97B5CFC8-CDFA-4EB5-B4CD-5B3CFA5CD844", 216)]
+  internal sealed class KeyValuePairTransformer : UnsignedIntArrayBoxTransformer<object> {
+    public override bool CanTransformType(Type type) {
+      return type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(KeyValuePair<,>));
+    }
+    protected override IEnumerable<uint> ToBoxType(object value, Mapper mapper) {
+      var type = value.GetType();
+      var pair = new uint[2];
+      pair[0] = mapper.GetBoxId(type.GetProperty("Key").GetValue(value));
+      pair[1] = mapper.GetBoxId(type.GetProperty("Value").GetValue(value));
+      return pair;
+    }
+    protected override object ToValueType(IEnumerable<uint> value, Type type, Mapper mapper) {
+      var key = mapper.GetObject(value.ElementAt(0));
+      var val = mapper.GetObject(value.ElementAt(1));
+      return Activator.CreateInstance(type, key, val);
+    }
+  }
   #endregion
 
   #region String
-  [Transformer("E75A594C-0034-4DAB-B28E-8F84F9F6DE8D", 215)]
+  [Transformer("E75A594C-0034-4DAB-B28E-8F84F9F6DE8D", 217)]
   internal sealed class StringTransformer : UnsignedIntBoxTransformer<string> {
     protected override uint ToBoxType(string value, Mapper mapper) { return mapper.GetStringId(value); }
@@ -356,5 +382,5 @@
 
   #region Enum
-  [Transformer("93FF076B-BC4B-4C39-8C40-15E004468C98", 216)]
+  [Transformer("93FF076B-BC4B-4C39-8C40-15E004468C98", 218)]
   internal sealed class EnumTransformer : UnsignedIntBoxTransformer<object> {
     public override bool CanTransformType(Type type) {
@@ -371,5 +397,5 @@
 
   #region Type
-  [Transformer("8D17FD28-383B-44E9-9BBF-B19D351C5E38", 218)]
+  [Transformer("8D17FD28-383B-44E9-9BBF-B19D351C5E38", 219)]
   internal sealed class TypeTransformer : UnsignedIntBoxTransformer<Type> {
     public override bool CanTransformType(Type type) {
@@ -381,5 +407,5 @@
   #endregion
 
-  #region Primitive Array Types
+  #region Array Types
   [Transformer("F25A73B2-6B67-4493-BD59-B836AF4455D1", 300)]
   internal sealed class BoolArrayTransformer : BoolArrayBoxTransformer<bool[]> {
@@ -459,4 +485,18 @@
     protected override string[] ToValueType(IEnumerable<string> value, Type type, Mapper mapper) { return value.ToArray(); }
   }
+
+  [Transformer("C83F0B5A-68D8-4271-81F9-FF259FC6F126", 400)]
+  internal sealed class GenericArrayTransformer : UnsignedIntArrayBoxTransformer<object> {
+    public override bool CanTransformType(Type type) {
+      return type.IsArray;
+    }
+    protected override IEnumerable<uint> ToBoxType(object value, Mapper mapper) {
+      var arr = (object[])value;
+      return arr.Select(x => mapper.GetBoxId(x));
+    }
+    protected override object ToValueType(IEnumerable<uint> value, Type type, Mapper mapper) {
+      return value.Select(x => mapper.GetObject(x)).ToArray();
+    }
+  }
   #endregion
 }
