Refactor Credentials to repo & interface, start working on credential tests