[#6529] Refactored login overlay logic out of allura.lib.security and added tests

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>