Cleaned title function

Making proper use of precmd and preexec functions