Add documentation, refactor code such that it will be more amenable to URL reversal tests.