Fixed dictionary serialization of reference values

Dictionary serialization methods assumed that the IDataSerialization
type (either key or value) was always a value type. However
default(TKey/TValue) returns null for reference types.

I also added a Test case to show that this is now working as intended