Version critical CSS and JS files (fixes #86)

This implements a simple way to version our critical JS and CSS files:
it adds a query parameter to their URLs that contains their last
modification time, according to the file system.  This will prevent
browsers from caching them when they change.

TODO: for performance, in the future we should find a nice way to cache
the mtime check so that it only happens once per server restart.
Fix md5 deprecation warning (fixes #873)

Use hashlib instead of md5, as announced in the deprecation warning.
Make it possible to close the results box (closes #894).

I changed player_ids that were set to 0 in the tests, because I don't think
we support 0 as a user ID (user IDs can only be positive integers).
I had a problem with a test because of that, so I also changed all of the others.
Show 'New game' as title of the tab for any game without a sentence (closes #883).

Previously, only games in 'create' state were given the 'New game' title,
but this bug has "reminded" us, that games in 'create' state may also be
canceled, resulting in a game where sentence is not set, and the state
is 'canceled'.

So now if a game doesn't have a sentence set, the tab title will default
to 'New game', regardless of what state the game is actually in.
Animate the levelup information (closes #885).

This implements the levelup animations:
- the star popping in
- the level bar risizing to its final width
- the level left score sliding along with the level bar
- the level left score counting down from score_next to score_left.

All of them happen simultaneously with the full game score animation.

Two deferred objects were used to keep track of both simoultaneous animations.
The level left score animation was done within the level bar animation,
using the 'step' function as supported by jquery's 'animate'.
Make the level bar animation slower (refs #885).

To better match the animation as seen on the videos;
Animate continue button and next game info (closes #886).

The animation is a bit different from the one on the video.
The main difference is that the continue button doesn't pop
up until the level bar animation has finished (in the video,
the continue button pops up while the level bar animation is
still running).
This was done for simplicity - to change as little code as possible.
If I wanted to make it more similar to the video, I'd have to
rewrite a couple of times more code than this way.
Make sure the 'Wait for GM to...' dialogs get closed (fixes #874).

The reason why the "Wait for GM to write the story" dialog stayed
shown even after moving to invitation state was a race condition
where two invocations of replay_create_game function were running
at the same time. See the tracker for more info:

http://tickets.farsides.com/issues/874
Implement complete for "anonymous" and "didn't vote" type players (closes #889).

This fixes the complete_anonymous state to not throw errors,
and the complete state for a player who didn't vote for a card,
which was visually broken before.

The player who didn't vote doesn't see the results box, but does see
the continue button and the next game info positioned in the center
of the board.
Implement anonymous views for 'create' and 'invitation' states (closes #890).

I ran into a problem with the jQuery query plugin, because the query plugin
parses the url when the page is loaded and caches the results (it never parses
the url again), which doesn't work properly with the HTML5 History API where
URL can change without page being reloaded.

This made the query plugin unusable for the anonymous views where the 'anonymous'
query parameter needs to be checked, so I implemented a very simple replacement
for the query plugin, the $.cardstories.url_param function.

Currently the anonymous 'create' state doesn't differ from a 'create' state where
a player is actively participating in the game. We might want to change it in the future,
so that it will be easier for the anonymous player to know he is not part of the game.
I didn't bother with this yet, because a player who wants to join a full game
first sees the 'game is full' dialog, which might be sufficient.
Fix a bug introduced by a previous commit (refs #890).

The new substitute for $.query.get returns null for params that
don't exist rather than an empty string.
Fix a bug where player's level score left is sometimes NaN (closes #887).

This also fixes some issues where the level score left would blink
before the final score was shown.

I thought about doing a test for this, but since it would have to look at the
DOM at certain exact point *during* the animation, the test would be hard to
write and would probably require me to put some hooks into the function to be
able to test it properly.
Since this was a rather trivial (and harmless) bug, I figured it wasn't
worth going through the trouble.
Cache file mtime values inside append_mtime() (fixes #884)

This uses the django cache engine to store file mtime values for 15
minutes (by default, timeout configurable in settings.py) in memory.
This prevents the main process having to access the filesystem multiple
times for every request.

An alternative would have been to cache just the template snippet where
the append_mtime tags are set, but this seemed to be a more transparent
(thus less error-prone) way to do it.
Merge branch 'master' of git://gitorious.org/~arbrandes/cardstories/arbrandes-cardstories
Add sounds to results animations (closes #892).

A new function $.cardstories_audio.stop was implemented to be able
to stop playing a sound clip.

The level bar animation duration was previously fixed, I changed it so
that the duration is adjusted proprtionaly to the length of the level bar
that needs to be animated.