Move authlogic helpers out to lib.