Use scoped_ptr for output stream pointer

This ensures a safe destroying/closing of the file output stream
Split code into several files
Merge branch 'master' of git@github.com:DerSauron/mydump
Encode strings as binary when needed, too
Move dump logic to own function