refactor into common-content

@jeremy @bf4

cleaning up some repetition and simplifying logic, also removing blank checks on filename, since we do not do them in content_disposition_field to avoid blowing up on invalid encoding
What is a "decode encode field" ? I see what the code does, but the name doesn't make sense out of the context of this diff.