Add nested encoding.
Add nested encoder test.