Force downloads to have an extension if invalid

Some URLs are of the form "filename.version1" etc, which Ruby thinks is
an extension. We want to cause these URLs to have an extension appended
using the regular logic.

To achieve this I've made the extension_white_list functionality
publicly available and used it to determine if what Ruby thinks is the
file extension is invalid, then give the file an extension.

Pivotal Ticket for this was closed.