backend rewritten to work with $conn

Rejoice @tceduard! you can now log in! ( you still need an admin table )