Use standard structure for if/for in shell

Mostly for clarity reasons; using this syntax:

    if [ condition ]; then
        commands
    fi

As opposed to:

    if [ condition ]
    then
        commands
    fi

Or:

    [ condition ] && command
Stop ignoring error output from setup commands
Keep export calls separate from definitions
Don't use backticks for command substitution

I thought the $( ) syntax wasn't defined by POSIX, but it is, and it
works in basically every modern Bourne shell including dash and ksh. As
it's much more readable and easier to nest I'll prefer it here.
Explicitly check for setup command existence
Speed up SVN prompt with only one call to svn info

Keep the output of `svn info` in a new local variable and use Bash
herestrings to read the repository URL and root from that variable
Trailing whitespace fixes
Improve comments on shell scripts