Overhauled saving document state.

A while ago, I made this same pull request but it seemed impossible to get git to behave so i could resolve conflicts. Here I am again with all the conflicts resolved.

There are a few issues with saving the layout of documents and tools. Consider the following.

```csharp
// 1: Gemini can save this ViewModel
[Export(typeof(HomeViewModel))]
public class HomeViewModel : Document

// 2: This doesn't work
[Export(typeof(IHomeBase))]
public class HomeViewModel : Document, IHomeBase

// 3: This also doesn't work (!!)
[Export]
public class HomeViewModel : Document

// 4: This works, but the ambiguity between the two attributes causes Gemini to use the first attribute
[Export(typeof(IMessage))]
[Export(typeof(IHomeBase))]
public class HomeViewModel : Document, IHomeBase, IMessage
```

All of these have been fixed. In cases 2 and 3, Gemini should now save the proper type name used to create the ViewModel.

In case 4, you have to change one ```[Export]``` to a ```[GeminiExport]```:

```csharp
[Export(typeof(IMessage))]
[GeminiExport(typeof(IHomeBase))] // Gemini will use this one
public class HomeViewModel : Document, IHomeBase, IMessage
```

Gemini wont fail silently like it did before.