Properly handle nested types when converting to map.
Merge pull request #40 from square/jw/nested-option-to-map

Properly handle nested types when converting to map.