Implement delete_dir in the FileStorage

plus options for deleting only empty directories and deleting
them recursively.

Not sure how cloudfile storage is or should be handled here. Are
things such as a "directory" even a concept there?
Convert media processing backends to delete the queue directory (#254)

We never deleted our queue directory which were created per submission.
With the FileStorage backend being able to delete directories now, we can
request the deletion of the task directory too. It will only be deleted if
it is completely empty.
Removing docstring bit about delete_file possibly deleting directories in the future

I agree that delete_dir as a separate operation is a better way to do
things, especially since there is a non-recursive deletion option that
will politely fail if the directory is not empty.
Basic itsdangerous infrastructure.

Implement the basic infrastructure for using itsdangerous
in mediagoblin. Usage instructions will follow.
Docs for get_timed_signer_url.
Improve fs security for itsdangerous secret.

Set mode 700 on the directory, mode 600 on the file.
Back sessions with It's Dangerous.

This is a contribution to #668.
Delete the session cookie on an empty session.
Remove beaker stuff from the code.

This is all obsoleted by It's Dangerous.
Set a starting value for session.send_new_cookie.

This makes session.__init__ slightly more complicated but probably
simplifies everything else, especially if we make the class smarter
later by having it track changes itself.
First tests for the Session class.
Harden It's Dangerous key management.

The previous code was theoretically subject to timing attacks, where
an attacker could read the key in between the time it was saved to the
file and when the chmod happened.  This version prevents that by using
umasks to ensure the files always have the right permissions.

This version also avoids using a key that cannot be saved due to some
system setup bug.
Call is_updated instead of testing it boolean.
Convenience functions for callable hooks
Merge remote-tracking branch 'cwebber/254_delete_queue_directories'

* cwebber/254_delete_queue_directories:
  Removing docstring bit about delete_file possibly deleting directories in the future
  Convert media processing backends to delete the queue directory (#254)
  Implement delete_dir in the FileStorage

Conflicts:
	mediagoblin/media_types/image/processing.py
	mediagoblin/media_types/video/processing.py

Conflicts, because those media_types already use the newer
proc_state.delete_queue_file() method (which needs
updating.
Implement queue dir delete for proc_state.delete_queue_file

Implement queue dir deleting in the
proc_state.delete_queue_file helper function.
Testing: Remove some left over files/dirs.

When using tempfile.* in testing, those files get created
in the system tempdir. The docs say, we should try to
remove them.
Yes, the next reboot will clean them up also.

And in the workbench case, check after each test, that the
global workbench dir is empty (so the sub-workbcnhes have
been destroyed).
Use cascade for comment deletion.

Also use the relationship for getting the comments on a
MediaEntry.
tests for new pluginapi methods that can't possibly pass yet :)
Merge remote-tracking branch 'brett/itsdangerous'

* brett/itsdangerous:
  Call is_updated instead of testing it boolean.
  Harden It's Dangerous key management.
  First tests for the Session class.
  Set a starting value for session.send_new_cookie.
  Remove beaker stuff from the code.
  Delete the session cookie on an empty session.
  Back sessions with It's Dangerous.
  Improve fs security for itsdangerous secret.
  Docs for get_timed_signer_url.
  Basic itsdangerous infrastructure.

Conflicts:
	mediagoblin/tests/test_cache.py