reorganize internal API for supporting auth-tables
fix auth-test passing when making login handlers