Remove upload methods from the scope when the widget is removed. Fixes #2258.
Merge branch 'master' into gh-pages