Correct nested dictionary serialization

I encountered an error trying to serialize nested dictionaries. See attached unit test. I think I was able to fix the issue - Dictionary type element was erroneously trying to use `WriteList` instead of `WriteDictionary`.