Shellcheck 20140915

A sweep of ShellCheck over the shell scripts (with shebangs at least). Feel free to cherry-pick, reorder, and tweak the commits.