Make autotype work in more situations

The window title will first be searched for the entry title. If the window title
does not contain the entry title, then the entry title will be searched for the
window title.