Nested messages are incorrectly converted to a hash

This supersedes #18 , and can be merged safely in to a future 1.1.0.