improved and extended cql_quote routine. Was O(n), now O(1). Handles datetime and collection objects