Small, regex-based URL parsing function for use in in browser-based JS