Lightweight javascript helper for working with URLs