finish conversion of code to BSD indentation style

This finishes the conversion of the code to the BSD indentation style, which is what the code is most similar to.

The main changes are:
 * some things indented with spaces are now tabs
 * cases within switch statements are not indented
 * fix some overly-indented code