Make validateSaveOriginUrl saner by using a proper URL parser.
Also removes dependency on validate.js.