refactored authentication_handler
better lookup of names from headers
Merge branch 'master' into refactoring