Merging Steve's code and cleanup, plus my fixes

If I see another tab character, I will scream

Merging immediately