Clean-up style and apply PEP-8 recommendations
Use cStringIO.StringIO for all file-like objects
Add the context manager protocol to the Writer object
Merge pull request #6 from matrixise/clean-code

Clean code