A few style changes + new features

This pull request performs a few style changes (mostly simple refactoring) and implements two new features:

* Use the value of a custom field to perform the search if no user is found using the requester's email.
* Add a setting to hash (using MD5) the email address before performing the search.

Please feel free to ask if you have any question or remarks so as I can rework the patch :)

/cc @maximeprades @shaialon