Using URI.js library, helps a LOT...