[bug 602990] Allow moderators to reply and edit locked questions.

The first commit is a refactoring of all the permission checks so that they go through the models instead of having a bunch of logic in the templates and again in the views.

The second commit is the actual bug fix. It allows for:

* Users with 'questions.add_answer' permission to reply to questions even if they are locked or archived.
* Users with 'questions.change_answer' permission to edit answers of locked or archived questions.

r?