lib: introduces JsonCurlRequest used to communicate with JSON REST APIs.

Also refactor github_api to use JsonCurlRequests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>