improved url module, fixed bugs, added test cases (commented out)