DRYer coding of platform-specific coding, making django utils more util-like (vs. shared)

Pulled this out of #557, to try and isolate the refactoring change there.

I have been running on this code for > 1 month, in the release-idoc branch.