Added Logout menu option.

Added logic to handle instance URL.