Added Logout menu option. Added logic to handle instance URL.

Hello,

Please review my change. I've added the Logout menu and improved instance URL login logic.

Thank you,

- Mykola