Test shutoff

Adds custom authorization for testlog tastypie endpoint to ensure that students cannot record answers after a test has been deactivated. Teachers are still able to do so.

The resulting error message is poorly rendered on the client side - we need a general way to parse Tastypie Unauthorized messages well on the client. Would also be good to enforce a redirect as a result.

I can try to look at this in the near future, but wanted to get something shippable in first.

@aronasorman @jamalex Please take a quick look. Tests written for the functionality pass.
Not a stupid question. It is copied from this gist: https://gist.github.com/1116962/58b7db0364de837ce229cdd8ef524bc9ff6da19f

I will checkout it without it to see if it actually matters.