Utilize LinkBatch for gender, NS_USER, and NS_USER_TALK lookups

Also split the query method out of UserNameBatch to simplify writing
the tests.

Change-Id: I55932951a90ea2295a3918f7b45490c4122c2770
Merge "Utilize LinkBatch for gender, NS_USER, and NS_USER_TALK lookups"