test multiple whitelisted domains
Reverse regex logic against whitelist

As per @coryvirok's comment.
Cleaned up variable grouping, and added some short-circuilt logic to
make code more clear.