URL parser that provides a lightweight solution when browserified and uses node's internal url parsing for a node environment