Big bug fix pack

Authentication should be working 100%, most features as well. A few bugs are still waiting to be exterminated.