Corrected logic in namespace_from_url. Will return None for invalid urls.
Tests for invalid URLs.