Implementation of a more generic authenticator 

This pull request addresses issues #49 and #96. This is a work in progress to get some feedback from @fernandoacorreia and @dnephin.