Users can edit their profile

* Factorized form fields.
* logout function can take a next argument for proper redirection.

Sorry for this big commit!