Finished up Authentication logic.
Merge pull request #7 from Onikoroshi/Authenticate

Finished up Authentication logic.