preview_handler changes to support Locators

@cpennington and @dmitchell Please review.

This is STUD-967, changing the code so that it will be able to handle descriptor.location being a Locator instead of a Location.

The changes ended up being minimal-- it was mostly just thinking through whether or not the usages of descriptor.location will be OK for Locators. I added some comments in the code for particular usages that were not obvious (to me).

@cpennington I am including you because you wrote the partial(replace_static_urls... code that I'm changing. I don't see why the arguments for that should be different from the arguments to replace_static_urls right above. data_dir is not needed for courses not being served out of xml_modulestore, and we already have a course_id defined.