Add mode 't' to all fopen functions. Resolves #9.

This will basically convert all Unix line endings to Windows line endings when run on Windows only.
Fix naming fail