Use queryset transformation to reduce number of queries on document revision page.
Re-organized wiki/models.py.

- Moved constants into wiki/constants.py
- Moved model managers into wiki/managers.py
- Moved decorators into wiki/decorators.py
- PEP8 cleanups.
Clean pyc files at the start of foreman automatically.