Conversion to/from nested dictionaries