Added a filename parameter to download_uri_target_to_dir
extracted the logic that translates a file found in a scanned directory to a url
Made it possible to pass in rewrite rules for the source url to use for download