Added functions to retrieve page recevied upon login and to test if last attempt was successful.
Reordered auth near the top so that following commands can be authenticated if possible. Some fixes to the recursion stuff.