improved portability using os module
improved how files are read
Merge pull request #1 from andlima/master

Minor improvements to file reading and portability