Re-enable memcache as a optional cache backend. Use it for locking.

- Also get rid of django-cache-machine as it was preventing the use
  of multiple cache backends (by relying on CACHE_BACKEND setting).

- Some minor code cleanup.