Change vim substitute to be more like vim.

- By default, make only one replacement.
- Add support for 'g' flag to replace all matches.