Make all function parameters constant

Parameters should not be re-assigned inside the function, and therefore
they are marked as constant variables.
Wrap long (>80) lines
Split multi-declaration oneliners
Separate 3rd-party includes from standard includes
Use (void) for empty function parameter lists for the sake of consistency
Include sys/types.h for gid_t
Fix type error of local string length variables

Using correct types fixes also signed-unsigned comparison error when the
sum of sizes are compared the to size of the buffer.
Rename local string size variables to match their actual meaning
Get rid of magic number
Remove unused variables
Fix free_json() to return void

Since json_decref() returns void, there is nothing which can go wrong at
the moment.
Respect the const qualifier of the return value of json_string_value()
Fix the type of the json entry index variable
Fix the type of the json array iterator
Add preliminary Makefile for testing purposes