Move doc_url function out of edxmako middleware

@cpennington Review, please?