Implements basic authentification security. Adds functional tests for
security.