add copyright headers and adjust some whitespace

Add copyright headers to two files, adjust whitespace in others, and tweak the .gitignore file.

@keertip