Better error handling

Closes #37
Update deps
Small refactor in mailer