Configurable authentication lookup

This is copied (and slightly modified) from vumi and is only used to test the new auth handler. If vumi has tests for it I'll copy them across as well.

I don't want to add any functionality until we need it.