Fix whitespace indenting

There was a huge mix of \t and "        " for indent in the script.
My tabstop is set as 4, and the code was pretty mangled. This
should at least make the code readable in any format.
Add a Vim modeline

Make sure all future whitespace goes in properly