Path matching utility based on the RAML spec in JavaScript