Fix file permissions and line terminations

The file permissions are inconstient in the source tree - this pull requests makes all file permissions 664.

Also the line terminations are inconsistent - some file have DOS (CRLF) and some have Unix (LF) line endings. This pull request makes all files use Unix line endings.