Rather large commit for only one test but the test was rather complicated, included creating a user, and then changing it. Also did various refactoring, added config etc