Removing calls to lower(active_email) from
queries with WHERE clauses that deal with active email.
Replaced query for finding accounts associated with a login token by
using a UNION instead of a larger and more inefficient join
Made sure we're sending active_email in lowercase before it gets to any
query.