*8684* Moved signIn/OutAsUser code to shared library

Pull request for: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8684