Remove duplication of definition of cacheKeyString
This is preliminary tidy up towards CRM-18443. There is no functional change, just the extraction of the definition
of the cacheKeyString & the joinClause. Extracting the join clause does not shorten it but it makes it
clear the clause is the same, ensures updates are done in all places & hopefully leads to the join being added
somewhere more sensible later - ie. instead of passing the join clause in call the same function, or a wrapper function
with $isExcludeDedupeExclusions as a paramter.