Minor import and heredoc cleanups
Rely on unittest module when available since it's pending deprecation on Django > 1.7.