slight refactor of duplicated code to set options from json object
read in key even if we're importing a configuration
let strncpy copy \0 as well..
json_object_object_get() is deprecated from json-c 0.11

but only added in 0.10, so add a configure check for it
and a macro that calls json_object_object_get_ex() if it's
available.

resolves #44