Overhaul runUpload.sh

- Reindent, fix style issues
- Reimplement logging
- Avoid using the shell for expanding file globs