Move "validateAuthority" to a common file

Both verify.js and well-known-parser.js must perform the same
validation checks on hostnames.