Clean-up and remove some imports

This makes `execCommit` point-free and removes some unnecessary manual
file handler management from `getEditorMessage`.