anchor.diff:      | PojoDU = 4
       | StringEnum = 5
       | DateTime = 6
  +    | MapOrDictWithNonStringKey = 7
  +
  +/// Helper for serializing map/dict with non-primitive, non-string keys such as unions and records.
  +/// Performs additional serialization/deserialization of the key object and uses the resulting JSON
  +/// representation of the key object as the string key in the serialized map/dict.
  +type MapSerializer<'k,'v when 'k : comparison>() =
  +    static member Deserialize(t:Type, reader:JsonReader, serializer:JsonSerializer) =
  +        let dictionary =
  +            serializer.Deserialize<Dictionary<string,'v>>(reader)
  +                |> Seq.fold (fun (dict:Dictionary<'k,'v>) kvp ->
  +                    use tempReader = new System.IO.StringReader(kvp.Key)
  +                    let key = serializer.Deserialize(tempReader, typeof<'k>) :?> 'k
  +                    dict.Add(key, kvp.Value)
  +                    dict
  +                    ) (Dictionary<'k,'v>())
  +        if t.IsGenericType && t.GetGenericTypeDefinition() = typedefof<Map<_,_>>
  +        then dictionary |> Seq.map (|KeyValue|) |> Map.ofSeq :> obj
  +        elif t.IsGenericType && t.GetGenericTypeDefinition() = typedefof<Dictionary<_,_>>
  +        then dictionary :> obj
  +        else failwith "MapSerializer input type wasn't a Map or a Dictionary"
  +    static member Serialize(value: obj, writer:JsonWriter, serializer:JsonSerializer) =
  +        let kvpSeq =
  +            match value with
  +            | :? Map<'k,'v> as mapObj -> mapObj |> Map.toSeq
  +            | :? Dictionary<'k,'v> as dictObj -> dictObj |> Seq.map (|KeyValue|)
  +            | _ -> failwith "MapSerializer input value wasn't a Map or a Dictionary"
  +        writer.WriteStartObject()
  +        use tempWriter = new System.IO.StringWriter()
  +        kvpSeq
  +            |> Seq.iter (fun (k,v) ->
  +                let key =
  +                    tempWriter.GetStringBuilder().Clear() |> ignore
  +                    serializer.Serialize(tempWriter, k)
  +                    tempWriter.ToString()
  +                writer.WritePropertyName(key)
  +                serializer.Serialize(writer, v) )
  +        writer.WriteEndObject() 
   
   /// Converts F# options, tuples and unions to a format understandable
   /// by Fable. Code adapted from Lev Gorodinski's original.
  
positive.code:     test Foo
      test Bar
      test <| DateTime(2016, 12, 13, 8, 00, 0)
  #endif
  
negative.code:                     then serializer.Serialize(writer, fields.[0])
                      else serializer.Serialize(writer, fields)
                      writer.WriteEndObject()
              | true, Kind.MapOrDictWithNonStringKey ->
                  let mapTypes = t.GetGenericArguments()
                  let mapSerializer = typedefof<MapSerializer<_,_>>.MakeGenericType mapTypes
                  let mapSerializeMethod = mapSerializer.GetMethod("Serialize")
                  mapSerializeMethod.Invoke(null, [| value; writer; serializer |]) |> ignore
              | true, _ ->
                  serializer.Serialize(writer, value)
  
  