Rewrite Writer in monadic style
Support for multitarget rules, fix string references