Fix unicode py2/3 interop.  Simultaneously, fix a bug in build_jsonlike_query.