Update json::Encoder to properly encode maps.

According to extra::serialize, maps where the key and value types
are encodable should also be encodable, but extra::json only handled
maps with string keys.  This updates extra::json to allow for
non-string keys.