mod. replace database (e.g. %(project)s) and table format elements in query_store entries with tokens to replaced by sub_tokens method.
mod. ensure escape_string in escape_var escapes a string without any whitespace.
fix. del connectons, use sub_tokens where instance and table names need to be substituted.  Remove stripping and splitting of SQL, unnecessary.
fix. secured rev_count_query and added test.