Decoder: compute container depth correctly
Encoder: refuse values that are nested too deeply

Fixes #9. (Really.)