Make auth factories flexible

Add prefix and responseBuilder options to Basic and OAuth factories to make them more flexible.

Close #798