Refactored password forgot to remove code duplication. Added tests for directives