Merge pull request #1141 from learning-unlimited/lua-issue-1056

Fixes issue #1056: catalog sort by timeblock(cherry picked from commit 364b36d36b2d56781171e5df95b8285c0c165f5b)
Merge pull request #1197 from learning-unlimited/stable-feb14-backports

Merge pull request #1141 from learning-unlimited/lua-issue-1056
Fixes bug with onsite classchange grid

The print_schedule() function was overriding the global 'data' variable,
which has all of the class and timeblock data, making it impossible to
do anything after printing a student's schedule.
Speeds up loading for onsite classchange grid

Before the grid loads, some profile data for all the students is loaded.
This data is mostly used for the autocomplete box, and includes student
names and id numbers. However, the grades of all students was also being
precomputed, even though grade data is not needed until after a student
is selected. This query takes an incredibly long time for large
programs.

Increases the performance of the grid loading by moving the computation
of the students grade from students_status() to get_schedule_json(), the
latter of which is called for individual students only when that data is
needed.
Merge pull request #1202 from learning-unlimited/onsite-fix

Fixes bug with onsite classchange grid
Merge pull request #1182 from learning-unlimited/dbmail_cron_lock

Add file lock for dbmail_cron.(cherry picked from commit f20284b34203c04bb10774e1d46d8da8137fb911)
Merge pull request #1206 from learning-unlimited/dbmail_cron_lock_backport

Merge pull request #1182 from learning-unlimited/dbmail_cron_lock
Chicago production site customizations