Move logic for matching users into method

This commit moves the logic for matching users in the sql authlogic
authenticator into a separate method for extensibility. This will allow
for a custom authenticator to inherit the sql authlogic class and
override the matching users method with a custom query.