Smarter login followup behavior.
- Do not lose referer after multiple bad entries
- Do not redirect back to external sites
- Code made more granular for readability
- Resolves VUFIND-886