Made it so funcs are passed in for multitenant db

It used to be a Regexes, but passing funcs which take in a connection
string and returns a bool that represents wether that connection string
is one corresponding to a multitenant db.
This is done (as mentiond in previous commit) to treate db's that are a
part of the same set of multitenant dbs as equal when cacheing queries
so that queries are not cached redundantly for each db part of the a set
of multitenant dbs.