Open/close actions on admin/event

This adds the following actions to the admin/event page

* Open; For a selected event e, this opens all events x where x > e or x = e
* Close; For a selected event e, this closes all events x where e > x or x = e

where a > b indicates that a is a parent or a grandparent of b.
Bugfix; Javascript in javascript

Fixes a bug where the text entered inside a javascript string
contained ' or ".
Improvements to dump.py

* Uses the following instead of os.system
	- subprocess.call
	- subprocess.Popen
	- shutil.copy
	- os.remove

* Uses os.path.join instead of string concatenation
* Compresses the backups and provides an alternative
  compressed version of aligulac.sql
Added gzip dump to db.html.
Improved some db queries.

Speedups (on live server):

* add
	- 3.5~4 times
* eventmgr
	- 35~45 times
More optimizations; /results/events

Decreased the number of queries and the total query time from
approx. (170, 2500ms) to approx. (80, 150ms).
More optimizations; /add/review

Same changes as for 47edfbb.
Merge pull request #106 from Prillan/sql-optimizations

Improved some db queries.
Merge pull request #104 from Prillan/dump

Improvements to the dump.py script
Merge pull request #102 from Prillan/reopen-action

Open/close actions on admin/event
Merge pull request #103 from Prillan/js-string-bug

Bugfix; Javascript in javascript
Moved report recomputation.
GET for mini URLs to avoid CSRF fucking up cache everywhere.
More optimizations; /results

Number of queries decreased from approx. 190 to approx. 30 by using
select_related. This greatly decreases CPU usage.
Merge pull request #109 from Prillan/sql-optimizations

More database optimizations
Clear cache after recompute.
Longer caching times for some views.