move rename functionality out of internals
- [ ] <s>closes #16045</s><b>update</b>Not anymore
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

@jorisvandenbossche can you confirm this is what you had in mind in that issue?