Fix miscellaneous problems with quoting of things. Problems with SOLR queries and Cql2/Cql3 compatibility.