Bring out a common interface and factor out the tiny bit of duplicated code.
As part of this update basic to also accept an application supplied password oracle. This was skipped initially because it duplicated a function in the martini-contrib auth package where this originated.