Token auth

Hold on merging. Almost done.