Allow writer to be set

Reincarnation of #93 with suggestions made.

Closes #101.
is it a mock or is it a fake what is going on i'm so confuse