added the ability to reset passwords and did some general refactoring