Tidy up existing throttling middleware.

The code was old, and doing things in a non-standard way.
Allow for more open-ended throttling.

We can look up usernames from JSON request bodies, and will simply
return 429 for requests that don't map to django templates.
Clean up changes to auth_throttling middleware.

Delay function can be supplied, but it is optional. A default delay
function is provided. Some of the functions used to do throttling are
now exposed, so that they could be used to do throttling outside of the
middleware.
Fix throttling code.

Fix bug in last commit, and switch to username only throttling function
after discussion with content team.
Update tests for new functionality.

Verify our default delay function, and verify we return 429 when we have
no template to update.
Update version of library.
Merge pull request #27 from sdelements/auth_throttle_ajax

Auth throttle ajax