[libsocialcache] Added a method for querying accounts

By which I mean, it has a map of prepared queries, and just looks up the prepared query using the query string as the hash key.  If it doesn't exist, it prepares the query and inserts it into the hash, else it just returns the already prepared query.  So, this code is fine as is.