[libsocialcache] Added a method for querying accounts

Note that prepare() takes a long time.  Probably best to have this query be a class member, and prepare it in the ctor, so that it can be execed immediately in this function, otherwise you pay about a millisecond each time this function is run.