Refactor WebsiteAgent#check_url.

Its function body is currently too large and deep, so divide it into several methods.