Iterm2 support and other tidbits

Hi,

fell tree to cherry-pick whatever you like from this.

I've added a new function, set_tab_title(), that allows you to set the tab title separately from the terminal titlebar, on terminals that support it (iTerm2.app on the Mac does, but I don't have access to others atm to test or add support for).

I've kept the same semantics as set_titlebar().