Move some parts of the tmux install script to functions