Added a function to check whether two URLs are from the same domain and unit tests for it.