Add .gitattributes

http://git-scm.com/docs/gitattributes
add last newline to the bin file
Move function out of the scope
Use already defined module

instead of load it again
Remove empty file
Merge pull request #327 from shinnn/patch

Add .gitattributes, and various tweaks