Bit more hacking. Authentication is kind of done-ish. Sending it up for review