Started rewriting login system. More work to do. CURRENTLY BROKEN.