refactor upload: extract metadata extraction

get_dtype(filename)
get_meta(filename, dtype)
extract upload_dist(), which contains just the logic needed to upload a package