Update authentication logic
Optionally authenticate on initialization
Merge pull request #1 from threatagent/develop

Improve authentication