Formatting cleanup

With very few exceptions, all of these changes are whitespace-only.  I replaced all tab characters with 4 spaces, removed any trailing spaces from lines, and then gave the files a quick once-over to correct any indentation weirdness once that was done.

I also replaced a few uses of the `%` and `?` aliases, which are generally frowned on.

Bracing and naming styles are still up in the air, but the code looks a great deal better just from standardizing the spaces/tabs.