Incorrect code for message deletion

[message deletion]

This code works incorrectly. I added it because it will be useful once the
necessary data model changes are done.
Deletion redesigned plus related changes

[message deletion]

Message deletion implemented base on the new data model where
deletetion is handled as adding a new MessageVersion flagged as
deleted.

Other changes in this commit:
- admin form displays new flag in MessageVersion inline,
- new method Message.change() to add a new version to a message that
  is altered in specified ways (easy to add a new version that is
  changed in only a single field; deletion is a special case to this),
- a bugfix in Message.get_conversation(),
- data member MessageVersion.author modified to allow blank (for
  messages posted by anonymous users),
- code added to correctly handle deleting messages incl. all special
  cases.
Sensible redirects added

[ui feature]

These redirect improve UI usability. On creation or modification, they
take the user to where their next action is likely to happen. E.g.
after a new heap is created, the user will be redirected to the page
of the new heap.
Edit message view handles conversation join/breaks

[model behavior improvement]

This cases are handled:
- joining conversations: if previously parent was None, and
  parent is set, delete the message's matching Conversation
  object,
- breaking conversation: if previously parent was set, and
  becomes None, create a new Conversation object.
Added database integrity check

[fsck]

Database integrity check (a.k.a. 'fsck') is accessible as a view, but
only to superusers. It runs several tests the detect possible
corruptions of the object database. I have written tests for all
errors I could think of, but that very probably does not cover all the
ways a database can go wrong.

Of course, the long-term goal is to have a UI that does not allow
creating an invalid database state.
fsck code made accessible as view, loop detection

[fsck]

The fsck code added in the previous commit is now actually made
accessible as a view.

Besides, a checking mechanism added for detecting loops in
`Message.get_root_message()`.
Creating user is made admin of new heaps

[ui feature]

Every heap needs an admin.
Merge branch 'redirects' into new-delete
editmessage view does not allow loop creation

[ui features]

The parent can be changed only in a way that does not introduce loops.
This has a side effect that means joining conversations and moving
messages between conversations is no longer possible via message
editing.

The generic view framework had to be extended for this change.
Removed several debugging print statements

[tidy]
Feature to add and remove conversation labels

[ui feature]

The next step will be displaying links to add and remove labels only
when the user has the right to use the features.
Add/remove links for convlabels iff user has right

[ui feature]

The add and remove label links are no longer displayed if the user has no right
to use them.
Added a comment to clarify magic number use

[tidy]
Replaced visibility-rights dict with tuple

[improvement]

This code is executed for every access check, so speed matters.
Support for anonymous posts improved

[ui feature]

Anonymous posting and editing now allowed.

I have considered whether taking over anonymous messages and making
one's own messages anonymous should be allowed. For now, I decided in
the former case, the answer is yes, so anyone can take over anonymous
messages as a further incentive towards registering :) However, I
think that disowning messages is a situation that can be perfectly
valid at times, but it should at least be considered by the heap's
owner or an administrator.
Merge pull request #3 from attish/new-delete

New delete
Facelift and UI for message labels added

[ui feature]

The most prominent feature in this commit is a thorough facelift. CSS
was added, though it now resides in the HTML file, and it should moved
into a separate, statically served stylesheet. The appearance now
includes an industry standard top bar, and parts of the message header
in the conversation view have been reshuffled into a more convenient
layout, now complete with Gravatar icons. In the absence of a Gravatar
icon, several default icons are used w.r.t. the rights of the author
on the heap. These icons are highly provisional, and at the moment,
they are hotlinked to other sites, which is a controversial practice,
so please do not deploy this version without serving these files
yourselves. Thanks.

Besides aesthetic improvements, I also coded two new views and related
UI to implement adding and removing message labels.

Remaining major usability issues:
- navigation, esp. stepping back to the conversation list of a heap
  from a specific conversation (a breadcrumb bar would be nice),
- conversation subjects cannot be altered from the UI,
- there is no way to merge conversations or move messages between
  conversations,
- anonymous users do not see a list of heaps accessible to them, so
  they can only access content via URLs.