Refactor authentication

* Easier string type conversion (would rather not having to, though)
* Added 'beforehand' helper
* Change argument order for functions using PlayerRepositories to make
  using them a bit neater