Start to implement version upload improvements.

When uploading a new version, recognize that and alter the action on
the form to submit the link id in the URL.

There is still a lot to do, like properly handling dialog destroying.

Remove some debugging statements from dialogs.js.
Remove debugging alert.