Add nested field support.

Here's the updated pull request for nested field support.