SQL query performance improvements.

This commit improves the SQL queries run within SQLAlchemy to reduce the
overhead of computing the overall progress and last activity.
SQL improvements for front page
SQL Improvements for Applications view.
Clean CACHE when specific events occur (new app, delete app, etc.)
Admin apps, now uses cached_apps.
Fix pagination for featured apps.