Add support for dynamic nesting key serialization. closes #684