move zsh history housekeeping into zsh