Modified the upload pattern to be used as a widget for NamedFiles

These are modifications to the 'upload' pattern so that it can be used as a widget for NamedFiles in plone.app.widgets. Some tests are written, but there are probably more needed for better coverage. There is a matching pull request for plone.app.widgets