login now redirects to the previously visited page if possible.  Permissions component rewritten to use proper DOM