SQL stuff. Index templating for admin section.

I couldn't test commit 38afdfe96f919fd9e2a594a2c9b274d1cf7e752f . It's probably a good idea to bypass the OAuth stuff in the *test environment* and automatically log in a mod.