Add/update license headers

This PR adds license headers to all source files and updates existing to have a common format. Also a couple of files had mixed LF/CRLF line endings which I also updated.

Should fix #38.