URL validation

Fixes #38

Also implements validation tests that were pending.