JavaScript function rewriter, for little DSLs