fix bug with multiple upload fields on a page

Fix a js scope bug that was preventing multiple upload fields to work as expected on a single page. Do so by unbinding prior events before binding new ones.

Also cleans up the function a little bit

fixes #64 and #65