Updates curl to use long flags, better JSON handling

The JSON handling correctly parses the output and gets the value by key
rather than relying on fixed format output and magic substitutes.