New 2-phase build process, fixes circular dependencies

Build curl with IPv6 and IDN support

Use json-c instead of jsmn; jsmn won't write JSON