migrate head of cider-and-ast branch from clj-refactor.el