Protect against recursive in_reply_to

Change the front-end UI to forbid setting a document as in-reply-to
itself. Change the controller to also avoid setting a document as
in-reply-to itself. Change the get_absolute_url function so that even if
a model does get set as in-reply-to itself, it avoids infinite
recursion.

Add tests for all that.