Improved the models and templatetags to be able to use the document plugin.