[bug 1081413] URL validation code edits, additions, and test

Added and edited url validation code and created a test for it.
This should be a `===`. The one in the email validation test should also be `===` (my bad).