URL parsing in javascript with validation, normalization, and matching.