The following types can be encoded and decoded by the json library:
dict, list, tuple, str, unicode, int, long, float, bool, NoneType.
JSONMetricValue can be constructed with any of these types, and used as part of Test.Result.
This patch also adds a toMetricValue function that converts a value into a MetricValue.
Wouldn't isinstance() be more canonical?
Also, this should probably verify that the container data types themselves contain representable items. Does the json lib provide a function to do that?