Made writer into a class with a couple of attributes for configuring output.