Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs	(revision 13347)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Reflection;
 using System.Text;
 
@@ -37,4 +38,10 @@
     Inherited = false)]
   public class StorableAttribute : Attribute {
+    public static bool IsStorable(MemberInfo memberInfo) {
+      return Attribute.IsDefined(memberInfo, typeof(StorableAttribute), false);
+    }
+    public static StorableAttribute GetStorableAttribute(MemberInfo memberInfo) {
+      return (StorableAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(StorableAttribute), false);
+    }
 
     /// <summary>
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs	(revision 13347)
@@ -36,10 +36,15 @@
     public StorableClassType Type { get; private set; }
 
+    public Guid Guid { get; private set; }
+    public bool Released { get; set; }
+
     /// <summary>
     /// Mark a class to be serialize by the <c>StorableSerizlier</c>
     /// </summary>
     /// <param name="type">The storable class type.</param>
-    public StorableClassAttribute(StorableClassType type) {
+    public StorableClassAttribute(StorableClassType type, string guid) {
       Type = type;
+      Guid = new Guid(guid);
+      Released = false;
     }
 
@@ -61,4 +66,8 @@
     }
 
+    public static StorableClassAttribute GetStorableClassAttribute(Type type) {
+      return (StorableClassAttribute)Attribute.GetCustomAttribute(type, typeof(StorableClassAttribute), false);
+    }
+
   }
 }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs	(revision 13347)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Reflection;
 
 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
@@ -34,4 +35,8 @@
   /// </summary>
   [AttributeUsage(AttributeTargets.Constructor, Inherited = false, AllowMultiple = false)]
-  public sealed class StorableConstructorAttribute : Attribute { }
+  public sealed class StorableConstructorAttribute : Attribute {
+    public static bool IsStorableConstructor(ConstructorInfo constructorInfo) {
+      return Attribute.IsDefined(constructorInfo, typeof(StorableConstructorAttribute));
+    }
+  }
 }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs	(revision 13347)
@@ -21,4 +21,6 @@
 
 using System;
+using System.Linq;
+using System.Reflection;
 
 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
@@ -50,4 +52,10 @@
   [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
   public sealed class StorableHookAttribute : Attribute {
+    public static bool IsStorableHook(MethodInfo methodInfo) {
+      return Attribute.IsDefined(methodInfo, typeof(StorableHookAttribute), false);
+    }
+    public static StorableHookAttribute[] GetStorableHookAttributes(MethodInfo methodInfo) {
+      return Attribute.GetCustomAttributes(methodInfo, false).OfType<StorableHookAttribute>().ToArray();
+    }
 
     private readonly HookType hookType;
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ComponentInfo.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ComponentInfo.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ComponentInfo.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Index.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Index.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Index.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -33,13 +33,13 @@
 
     public Index() {
-      indexes = new Dictionary<T, uint>();
-      values = new Dictionary<uint, T>();
-      nextIndex = 1;
+      this.indexes = new Dictionary<T, uint>();
+      this.values = new Dictionary<uint, T>();
+      nextIndex = 0;
     }
-    public Index(IEnumerable<Tuple<uint, T>> values)
+    public Index(IEnumerable<T> values)
       : this() {
       foreach (var value in values) {
-        this.indexes.Add(value.Item2, value.Item1);
-        this.values.Add(value.Item1, value.Item2);
+        this.indexes.Add(value, nextIndex);
+        this.values.Add(nextIndex, value);
         nextIndex++;
       }
@@ -47,7 +47,6 @@
 
     public uint GetIndex(T value) {
-      uint index = 0;
-      indexes.TryGetValue(value, out index);
-      if (index == 0) {
+      uint index;
+      if (!indexes.TryGetValue(value, out index)) {
         index = nextIndex;
         nextIndex++;
@@ -60,6 +59,6 @@
       return values[index];
     }
-    public IEnumerable<Tuple<uint, T>> GetValues() {
-      return values.Select(x => new Tuple<uint, T>(x.Key, x.Value));
+    public IEnumerable<T> GetValues() {
+      return values.Values;
     }
   }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Mapper.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Mapper.cs	(revision 13347)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Mapper.cs	(revision 13347)
@@ -0,0 +1,151 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.PluginInfrastructure;
+using Google.ProtocolBuffers;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Persistence {
+  public sealed class Mapper {
+    private Index<ITransformer> transformers;
+    private Dictionary<Type, TypeInfo> typeInfos;
+    private Index<Type> types;
+    private Index<string> strings;
+    private Index<Box> boxes;
+    private Dictionary<object, uint> boxCache;
+    private Dictionary<uint, object> objectCache;
+
+    public long BoxCount { get; private set; }
+
+    public Mapper() {
+      transformers = new Index<ITransformer>();
+      typeInfos = new Dictionary<Type, TypeInfo>();
+      types = new Index<Type>();
+      strings = new Index<string>();
+      boxes = new Index<Box>();
+      boxCache = new Dictionary<object, uint>(new ReferenceEqualityComparer<object>());
+      objectCache = new Dictionary<uint, object>();
+
+      BoxCount = 0;
+
+      foreach (var transformer in ApplicationManager.Manager.GetInstances<ITransformer>().OrderBy(x => x.Order)) {
+        transformer.Initialize(transformers.GetIndex(transformer));
+      }
+    }
+
+    public TypeInfo GetTypeInfo(Type type) {
+      TypeInfo typeInfo;
+      if (!typeInfos.TryGetValue(type, out typeInfo)) {
+        var transformer = transformers.GetValues().Where(x => x.CanTransformType(type)).FirstOrDefault();
+        typeInfo = new TypeInfo(type, transformer);
+        typeInfos.Add(type, typeInfo);
+      }
+      return typeInfo;
+    }
+    public IEnumerable<TypeInfo> GetTypeInfos() {
+      return typeInfos.Values;
+    }
+    public IEnumerable<Type> GetTypes() {
+      return typeInfos.Values.Select(x => x.Type);
+    }
+
+    public uint GetTypeId(Type type) {
+      return types.GetIndex(type);
+    }
+    public Type GetType(uint typeId) {
+      return types.GetValue(typeId);
+    }
+
+    public uint GetStringId(string str) {
+      return strings.GetIndex(str);
+    }
+    public string GetString(uint stringId) {
+      return strings.GetValue(stringId);
+    }
+
+    public uint GetBoxId(object o) {
+      uint boxId;
+      if (boxCache.TryGetValue(o, out boxId)) return boxId;
+
+      if (o == null)
+        boxId = boxes.GetIndex(null);
+      else {
+        var type = o.GetType();
+        var typeInfo = GetTypeInfo(type);
+        if (typeInfo.Transformer == null) throw new ArgumentException("Cannot serialize object of type " + o.GetType());
+        BoxCount++;
+        typeInfo.Used++;
+        boxId = boxes.GetIndex(typeInfo.Transformer.ToBox(o, this));
+      }
+      boxCache.Add(o, boxId);
+      return boxId;
+    }
+    public object GetObject(uint boxId) {
+      object o;
+      if (objectCache.TryGetValue(boxId, out o)) return o;
+
+      var box = this.boxes.GetValue(boxId);
+      if (box == null)
+        o = null;
+      else {
+        var transformer = transformers.GetValue(box.TransformerId);
+        o = transformer.ToObject(box, this);
+      }
+      objectCache.Add(boxId, o);
+      return o;
+    }
+
+    public object CreateInstance(Type type) {
+      return GetTypeInfo(type).GetConstructor()();
+    }
+
+    public static Bundle ToBundle(object o) {
+      var mapper = new Mapper();
+      var bundle = Bundle.CreateBuilder();
+      bundle.RootBoxId = mapper.GetBoxId(o);
+      bundle.AddRangeTransformerGuids(mapper.transformers.GetValues().Select(x => x.Guid).Select(x => ByteString.CopyFrom(x.ToByteArray())));
+      bundle.AddRangeTypeGuids(mapper.types.GetValues().Select(x => mapper.typeInfos[x].StorableClassAttribute.Guid).Select(x => ByteString.CopyFrom(x.ToByteArray())));
+      bundle.AddRangeStrings(mapper.strings.GetValues());
+      bundle.AddRangeBoxes(mapper.boxes.GetValues());
+      return bundle.Build();
+    }
+    public static object ToObject(Bundle bundle) {
+      var types = new Dictionary<Guid, Type>();
+      foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
+        foreach (var t in asm.GetTypes().Where(x => StorableClassAttribute.IsStorableClass(x)))
+          types.Add(StorableClassAttribute.GetStorableClassAttribute(t).Guid, t);
+      }
+
+      var mapper = new Mapper();
+      mapper.types = new Index<Type>(bundle.TypeGuidsList.Select(x => new Guid(x.ToByteArray())).Select(x => types[x]));
+      mapper.strings = new Index<string>(bundle.StringsList);
+      mapper.boxes = new Index<Box>(bundle.BoxesList);
+      mapper.transformers = new Index<ITransformer>(bundle.TransformerGuidsList.Select(x => new Guid(x.ToByteArray())).Select(x => mapper.transformers.GetValues().First(y => y.Guid == x)));
+      foreach (var type in mapper.types.GetValues())
+        mapper.typeInfos.Add(type, new TypeInfo(type));
+
+      return mapper.GetObject(bundle.RootBoxId);
+    }
+  }
+}
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/PersistenceMapper.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/PersistenceMapper.cs	(revision 13346)
+++ 	(revision )
@@ -1,146 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Persistence.Data;
-using HeuristicLab.PluginInfrastructure;
-
-namespace HeuristicLab.Persistence {
-  public sealed class PersistenceMapper {
-    private ShortIndex<ITransformer> transformers;
-    private Dictionary<Type, TypeInfo> typeInfos;
-    private ShortIndex<Type> types;
-    private Index<string> strings;
-    private Index<PersistenceData> data;
-    private Dictionary<object, uint> dataCache;
-    private Dictionary<uint, object> objectCache;
-
-    public long Nodes { get; private set; }
-
-    public PersistenceMapper() {
-      transformers = new ShortIndex<ITransformer>();
-      typeInfos = new Dictionary<Type, TypeInfo>();
-      types = new ShortIndex<Type>();
-      strings = new Index<string>();
-      data = new Index<PersistenceData>();
-      dataCache = new Dictionary<object, uint>(new ReferenceEqualityComparer<object>());
-      objectCache = new Dictionary<uint, object>();
-
-      Nodes = 0;
-
-      foreach (var transformer in ApplicationManager.Manager.GetInstances<ITransformer>().OrderBy(x => x.Order)) {
-        ushort id = transformers.GetIndex(transformer);
-        transformer.Initialize(id);
-      }
-    }
-
-    public TypeInfo GetTypeInfo(Type type) {
-      TypeInfo typeInfo;
-      typeInfos.TryGetValue(type, out typeInfo);
-      if (typeInfo == null) {
-        var transformer = transformers.GetValues().Select(x => x.Item2).Where(x => x.CanTransformType(type)).FirstOrDefault();
-        typeInfo = new TypeInfo(type, transformer);
-        typeInfos.Add(type, typeInfo);
-      }
-      return typeInfo;
-    }
-    public IEnumerable<TypeInfo> GetTypeInfos() {
-      return typeInfos.Values;
-    }
-    public IEnumerable<Type> GetTypes() {
-      return typeInfos.Values.Select(x => x.Type);
-    }
-
-    public ushort GetTypeId(Type type) {
-      return types.GetIndex(type);
-    }
-    public Type GetType(ushort typeId) {
-      return types.GetValue(typeId);
-    }
-
-    public uint GetStringId(string str) {
-      return strings.GetIndex(str);
-    }
-    public string GetString(uint stringId) {
-      return strings.GetValue(stringId);
-    }
-
-    public void Cache(object o, PersistenceData data) {
-      dataCache.Add(o, this.data.GetIndex(data));
-    }
-    public void Cache(PersistenceData data, object o) {
-      objectCache.Add(this.data.GetIndex(data), o);
-    }
-
-    public uint GetDataId(object o) {
-      if (o == null) return 0;
-      if (dataCache.ContainsKey(o)) return dataCache[o];
-
-      var type = o.GetType();
-      var typeInfo = GetTypeInfo(type);
-      if (typeInfo.Transformer == null) throw new ArgumentException("Cannot serialize object of type " + o.GetType());
-      Nodes++;
-      typeInfo.Used++;
-      return data.GetIndex(typeInfo.Transformer.ToData(o, this));
-    }
-    public object GetObject(uint dataId) {
-      if (dataId == 0) return null;
-      if (objectCache.ContainsKey(dataId)) return objectCache[dataId];
-      var data = this.data.GetValue(dataId);
-      var transformer = transformers.GetValue(data.TransformerId);
-      return transformer.ToObject(data, this);
-    }
-
-    public object CreateInstance(Type type) {
-      return GetTypeInfo(type).GetConstructor()();
-    }
-
-    public static PersistenceMapper mapper;
-    public static PersistenceBundle ToBundle(object o) {
-      mapper = new PersistenceMapper();
-      var bundle = new PersistenceBundle();
-      bundle.RootId = mapper.GetDataId(o);
-      bundle.TransformerGuids = mapper.transformers.GetValues().Select(x => new Tuple<ushort, Guid>(x.Item1, x.Item2.Guid)).ToArray();
-      bundle.TypeNames = mapper.types.GetValues().Select(x => new Tuple<ushort, string>(x.Item1, x.Item2.AssemblyQualifiedName)).ToArray();
-      bundle.Strings = mapper.strings.GetValues().ToArray();
-      bundle.Data = mapper.data.GetValues().ToArray();
-      return bundle;
-    }
-    public static object ToObject(PersistenceBundle bundle) {
-      mapper = new PersistenceMapper();
-      mapper.types = new ShortIndex<Type>(bundle.TypeNames.Select(x => new Tuple<ushort, Type>(x.Item1, Type.GetType(x.Item2, true))));
-      mapper.strings = new Index<string>(bundle.Strings);
-      mapper.data = new Index<PersistenceData>(bundle.Data);
-      mapper.transformers = new ShortIndex<ITransformer>(
-        bundle.TransformerGuids.Select(x => new Tuple<ushort, ITransformer>(
-          x.Item1,
-          mapper.transformers.GetValues().Select(y => y.Item2).Where(y => y.Guid == x.Item2).First())
-        )
-      );
-      foreach (var type in mapper.types.GetValues().Select(x => x.Item2))
-        mapper.typeInfos.Add(type, new TypeInfo(type));
-
-      return mapper.GetObject(bundle.RootId);
-    }
-  }
-}
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ProtoBufSerializer.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ProtoBufSerializer.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ProtoBufSerializer.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -21,14 +21,13 @@
 
 using System.IO;
-using HeuristicLab.Persistence.Data;
 
 namespace HeuristicLab.Persistence {
   public sealed class ProtoBufSerializer : Serializer {
-    protected override void SerializePersistenceBundle(PersistenceBundle bundle, Stream stream) {
-      ProtoBuf.Serializer.Serialize<PersistenceBundle>(stream, bundle);
+    protected override void SerializeBundle(Bundle bundle, Stream stream) {
+      bundle.WriteTo(stream);
     }
 
-    protected override PersistenceBundle DeserializePersistenceBundle(Stream stream) {
-      return ProtoBuf.Serializer.Deserialize<PersistenceBundle>(stream);
+    protected override Bundle DeserializeBundle(Stream stream) {
+      return Bundle.ParseFrom(stream);
     }
   }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ReferenceEqualityComparer.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ReferenceEqualityComparer.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/ReferenceEqualityComparer.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Serializer.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Serializer.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Serializer.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -22,10 +22,9 @@
 using System.IO;
 using System.IO.Compression;
-using HeuristicLab.Persistence.Data;
 
 namespace HeuristicLab.Persistence {
   public abstract class Serializer : ISerializer {
     public virtual void Serialize(object o, Stream stream) {
-      SerializePersistenceBundle(PersistenceMapper.ToBundle(o), stream);
+      SerializeBundle(Mapper.ToBundle(o), stream);
     }
     public virtual void Serialize(object o, string path) {
@@ -44,8 +43,8 @@
       }
     }
-    protected abstract void SerializePersistenceBundle(PersistenceBundle bundle, Stream stream);
+    protected abstract void SerializeBundle(Bundle bundle, Stream stream);
 
     public virtual object Deserialize(Stream stream) {
-      return PersistenceMapper.ToObject(DeserializePersistenceBundle(stream));
+      return Mapper.ToObject(DeserializeBundle(stream));
     }
     public virtual object Deserialize(string path) {
@@ -63,5 +62,5 @@
       }
     }
-    protected abstract PersistenceBundle DeserializePersistenceBundle(Stream stream);
+    protected abstract Bundle DeserializeBundle(Stream stream);
   }
 }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StorableAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StorableAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StorableAttribute.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StorableClassAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StorableClassAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StorableClassAttribute.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -27,10 +27,8 @@
   public sealed class StorableClassAttribute : Attribute {
     public Guid Guid { get; private set; }
-    public int Version { get; set; }
     public bool Released { get; set; }
 
     public StorableClassAttribute(string guid) {
       Guid = new Guid(guid);
-      Version = 0;
       Released = false;
     }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Transformer.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Transformer.cs	(revision 13347)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Transformer.cs	(revision 13347)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Persistence {
+  internal abstract class Transformer : ITransformer {
+    public Guid Guid { get; private set; }
+    public uint Id { get; private set; }
+    public uint Order { get; private set; }
+
+    protected Transformer() {
+      Guid = TransformerAttribute.GetGuid(this.GetType());
+      Order = TransformerAttribute.GetOrder(this.GetType());
+      Id = 0;
+    }
+
+    public void Initialize(uint id) {
+      Id = id;
+    }
+
+    public abstract bool CanTransformType(Type type);
+    public abstract Box ToBox(object o, Mapper mapper);
+    public abstract object ToObject(Box box, Mapper mapper);
+  }
+}
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TransformerAttribute.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TransformerAttribute.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TransformerAttribute.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -26,7 +26,7 @@
   public sealed class TransformerAttribute : Attribute {
     public Guid Guid { get; private set; }
-    public ushort Order { get; private set; }
+    public uint Order { get; private set; }
 
-    public TransformerAttribute(string guid, ushort order) {
+    public TransformerAttribute(string guid, uint order) {
       Guid = new Guid(guid);
       Order = order;
@@ -42,5 +42,5 @@
       return GetTransformerAttribute(type).Guid;
     }
-    public static ushort GetOrder(Type type) {
+    public static uint GetOrder(Type type) {
       return GetTransformerAttribute(type).Order;
     }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TransformerBase.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TransformerBase.cs	(revision 13346)
+++ 	(revision )
@@ -1,45 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using HeuristicLab.Persistence.Data;
-
-namespace HeuristicLab.Persistence {
-  internal abstract class TransformerBase : ITransformer {
-    public Guid Guid { get; private set; }
-    public ushort Id { get; private set; }
-    public ushort Order { get; private set; }
-
-    protected TransformerBase() {
-      Guid = TransformerAttribute.GetGuid(this.GetType());
-      Order = TransformerAttribute.GetOrder(this.GetType());
-      Id = 0;
-    }
-
-    public void Initialize(ushort id) {
-      Id = id;
-    }
-
-    public abstract bool CanTransformType(Type type);
-    public abstract PersistenceData ToData(object o, PersistenceMapper mapper);
-    public abstract object ToObject(PersistenceData data, PersistenceMapper mapper);
-  }
-}
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj	(revision 13347)
@@ -46,4 +46,15 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Core\ComponentInfo.cs" />
+    <Compile Include="Core\Index.cs" />
+    <Compile Include="Core\Mapper.cs" />
+    <Compile Include="Core\ProtoBufSerializer.cs" />
+    <Compile Include="Core\ReferenceEqualityComparer.cs" />
+    <Compile Include="Core\Serializer.cs" />
+    <Compile Include="Core\Transformer.cs" />
+    <Compile Include="Core\TransformerAttribute.cs" />
+    <Compile Include="Core\TypeInfo.cs" />
+    <Compile Include="ISerializer.cs" />
+    <Compile Include="ITransformer.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -62,4 +73,8 @@
       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
       <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102bc7d3-0ef9-439c-8f6d-96ff0fdb8e1b}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
     </ProjectReference>
   </ItemGroup>
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/ISerializer.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/ISerializer.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/ISerializer.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/ITransformer.cs
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/ITransformer.cs	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/ITransformer.cs	(revision 13347)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -21,17 +21,16 @@
 
 using System;
-using HeuristicLab.Persistence.Data;
 
 namespace HeuristicLab.Persistence {
   public interface ITransformer {
     Guid Guid { get; }
-    ushort Id { get; }
-    ushort Order { get; }
+    uint Id { get; }
+    uint Order { get; }
 
-    void Initialize(ushort id);
+    void Initialize(uint id);
 
     bool CanTransformType(Type type);
-    PersistenceData ToData(object o, PersistenceMapper mapper);
-    object ToObject(PersistenceData data, PersistenceMapper mapper);
+    Box ToBox(object o, Mapper mapper);
+    object ToObject(Box box, Mapper mapper);
   }
 }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Plugin.cs.frame
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Plugin.cs.frame	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Plugin.cs.frame	(revision 13347)
@@ -29,4 +29,5 @@
   [PluginFile("HeuristicLab.Persistence-4.0.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.ProtobufCS", "2.4.1.473")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
   public class HeuristicLabPersistencePlugin : PluginBase { }
 }
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Properties/AssemblyInfo.cs.frame	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Properties/AssemblyInfo.cs.frame	(revision 13347)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using System.Reflection;
 using System.Runtime.CompilerServices;
@@ -53,2 +54,4 @@
 [assembly: AssemblyVersion("4.0.0.0")]
 [assembly: AssemblyFileVersion("4.0.0.$WCREV$")]
+
+[assembly: CLSCompliant(false)]
Index: branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Protos/PersistenceMessages.proto
===================================================================
--- branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Protos/PersistenceMessages.proto	(revision 13346)
+++ branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Protos/PersistenceMessages.proto	(revision 13347)
@@ -1,6 +1,127 @@
 package HeuristicLab.Persistence;
 
-message PersistenceBox {
-  required uint32 TransformerId = 1;
-  required uint32 TypeId = 2;
+message Bundle {
+  repeated bytes transformer_guids = 1;
+  repeated bytes type_guids = 2;
+  repeated string strings = 3;
+  repeated Box boxes = 4;
+  required uint32 root_box_id = 5;
 }
+
+message Box {
+  optional uint32 transformer_id = 1;
+  optional uint32 type_id = 2;
+
+  extensions 100 to max;
+}
+
+// value boxes
+message BoolBox {
+  extend Box {
+    required BoolBox bool = 100;
+  }
+  required bool value = 1;
+}
+message IntBox {
+  extend Box {
+    required IntBox int = 101;
+  }
+  required int32 value = 1;
+}
+message LongBox {
+  extend Box {
+    required LongBox long = 102;
+  }
+  required int64 value = 1;
+}
+message UnsignedIntBox {
+  extend Box {
+    required UnsignedIntBox unsigned_int = 103;
+  }
+  required uint32 value = 1;
+}
+message UnsignedLongBox {
+  extend Box {
+    required UnsignedLongBox unsigned_long = 104;
+  }
+  required uint64 value = 1;
+}
+message FloatBox {
+  extend Box {
+    required FloatBox float = 105;
+  }
+  required float value = 1;
+}
+message DoubleBox {
+  extend Box {
+    required DoubleBox double = 106;
+  }
+  required double value = 1;
+}
+message StringBox {
+  extend Box {
+    required StringBox string = 107;
+  }
+  required string value = 1;
+}
+message BytesBox {
+  extend Box {
+    required BytesBox bytes = 108;
+  }
+  required bytes value = 1;
+}
+
+// array boxes
+message ArrayBox {
+  extend Box {
+    required ArrayBox array = 120;
+  }
+  optional uint32 element_type_id = 1;
+
+  extensions 100 to max;
+}
+message BoolArrayBox {
+  extend ArrayBox {
+    required BoolArrayBox bool_array = 100;
+  }
+  repeated bool values = 1 [packed = true];
+}
+message IntArrayBox {
+  extend ArrayBox {
+    required IntArrayBox int_array = 101;
+  }
+  repeated int32 values = 1 [packed = true];
+}
+
+// matrix boxes
+message MatrixBox {
+  extend Box {
+    required MatrixBox matrix = 140;
+  }
+  optional uint32 element_type_id = 1;
+  repeated uint32 lengths = 2 [packed = true];
+
+  extensions 100 to max;
+}
+message BoolMatrixBox {
+  extend MatrixBox {
+    required BoolMatrixBox bool_matrix = 100;
+  }
+  repeated bool values = 1 [packed = true];
+}
+message IntMatrixBox {
+  extend MatrixBox {
+    required IntMatrixBox int_matrix = 101;
+  }
+  repeated int32 values = 1 [packed = true];
+}
+
+// composite boxes
+message DictionaryBox {
+  extend Box {
+    required DictionaryBox dictionary = 160;
+  }
+  repeated uint32 key_ids = 1 [packed = true];
+  repeated uint32 value_ids = 2 [packed = true];
+  required uint32 comparer_id = 3;
+}
