Fixed configuration and cql values

Fixed configuration to fall back to main threads configuration values when there is no configuration for current thread. 
Also changed cql value to escape everything except Numeric values and UUIDs