Added flask_mail to extensions
Refactored app.py