Make PuSHing the Pubhubsubbub server an async task (#436, #585)

Notifying the PuSH servers had 3 problems. 

1) it was done immediately after sending of the processing task to celery. So if celery was run in a separate
process we would notify the PuSH servers before the new media was processed/
visible. (#436)

2) Notification code was called in submit/views.py, so submitting via the
   API never resulted in notifications. (#585)

3) If Notifying the PuSH server failed, we would never retry.

The solution was to make the PuSH notification an asynchronous subtask. This
way: 1) it will only be called once async processing has finished, 2) it
is in the main processing code path, so even API calls will result in
notifications, and 3) We retry 3 times in case of failure before giving up.
If the server is in a separate process, we will wait 3x 2 minutes before
retrying the notification.

The only downside is that the celery server needs to have access to the internet
to ping the PuSH server. If that is a problem, we need to make the task belong
to a special group of celery servers that has access to the internet.

As a side effect, I believe I removed the limitation that prevented us from
upgrading celery.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Don't pass request into run_process_media

People(tm) want to start run_process_media from the CLI and might not
have a request object handy. So pass in the feed_url into
run_process_media rather than the request object and allow the feed url
to be empty (resulting in no PuSH notification at all then).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Merge remote-tracking branch 'refs/remotes/spaetz/436_celery_push'
Normalize the email address in the same way in all places

We were case normalizing the email address for registration, but not at
all for the forgotten password retrieval. Make a
tools.mail.normalize_email helper that can be used to normalize the
email in the same way in all places.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Restructure ForgotPassword view

1) Remove mongo limitations (no 'or' when querying for either username
or email).

2) Lost password function revealed if an user name or email address
   is registered, which can be considered a data leak.
   Leaking user names is OK, they are public anyway, but don't reveal
   lookup success in case the lookup happened by email address.
   Simply respond: "If you have an account here, we have send you
                    your email"?

3) username and email search was case sensitive. Made username search
   case insensitive (they are always stored lowercase in the db).
   Keep email-address search case sensitive for now. This might need
   further discussion

4) Remove a whole bunch of indention in the style of:
   if no error:
        ...
        if no error:
            ...
            if no error:
                actually do something in the regular case

   by restructuring the function.

5) Outsource the sanity checking for username and email fields into the
   validator function. This way, we get automatic case sanity checking
   and sanitizing for all required fields.

6) Require 5-char password and fix tests

   Originally, the Change password form required a password between 6-30
   chars while the registration and login form did not require anything
   special. This commit introduces a common minimum limit for all forms
   which breaks the test suite which uses a 5 char password by
   default. :-).  As 5 chars seem sensible enough to enforce (people
   should be picking much longer ones anyway), just reduce the limit to
   5 chars, thereby making all tests pass.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Also set login_failed in case of form errors

If we send a POST request to the login page which contained form errors
(e.g. a too short password), the variable "login_failed" was not set to
true. This condition was tested by the test suite however, so we should
make sure that login_failed is set even if the form failed to validate.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Moved MediaComment form descriptions to apt. place
Made the image sampling filter configurable

- Changed the default to BICUBIC instead of previous ANTIALIAS