escape strings; allow '=' to be key/val separator
make nest part of EncodeState instead of passing it as arg