Context-ify and modernize SFUploadWindow

Cleared out a few globals by replacing them with ContextSource functions
and turned a few wgOut error functions into exceptions.

Change-Id: I8b583a04184d61a287fe4a66419484aeeffc965f
Merge "Context-ify and modernize SFUploadWindow"