Whitespace fixes

This adds a `.gitattributes`, normalizes the line endings, and replaces tabs with spaces. I tried to leave all formatting as-is.