Lots of refactoring. Macros in Vi mode.