refactor output to different Writer implementations. Adding custom output should be easy now.

fixes #12