Add logout support, and make sure login targets the top frame.