Task 1347 - UserDao refactorings and Unit tests

In this branch I also renamed every instance of userName -> username for uniformity's sake