Flesh out some template tags

Rename template tags:

* category_next_out => category_next_due_out
* category_next_back => category_next_due_back

Flesh out both of the above template tags. Change the import in `base.html` to
reflect the renames, and change the field labels in `base.html` to reflect the
changes. Refactor some of `category_tools.py` to reduce duplication.