Added .gitattributes file for line endings.

Line encodings should now be uniform and stop causing trouble.
Fixed channel file write error.

Added the missing "a" descriptor to the open call.
Now *.bat files will have windows line endings.
Refactored analysis.py into a class.

It now has a variable section string, allowing it to run as using for
example the "GenAlg" section for its file paths and alternatively with
another set of path strings when run as an analysis tool.