Run update_docs and update_imported_docs in unit tests

This allows me to be more comfortable with trying to refactor the massive functions in `tasks.py`.

This contains a minor refactoring of moving two functions out of `update_docs` as well.