Refactored rewriter, added 'remove' option, updated config