Remove hard-coded timeout for cache

Now it can be configured via the settings_local.py file
Cache App details to speed up page loads

This commit caches the App itself in the cache, speeding up the page serving.
Add DELETE on CASCADE to foreign keys
Use new App cache

This commit updates the usage of the cache to load app details, and reduce the hits
in the DB.
Reload apps from the DB for tests
Refresh cache also with API calls
Merge pull request #588 from PyBossa/issue-586-cache

Issue 586 cache