move query logics into repositories, fixes https://github.com/Eluinhost/TeamspeakAuth/issues/51