Add a couple of helper functions for department

This adds `try_get_department` and `SetDepartment`, which will be used
in the collector for Google Analytics data relating to the content
dashboards project.