Update OAuthManager and IdentityRepository tests and refactor slightly so tests actually catch a bug I've come across before. Mocks are a pain in the ass.