Make JSON to GVariant conversion handle some string to number conversions.

Consider the following JSON: ["123"]
Trying to convert it to GVariant with signature "(i)" would previously fail,
as string-to-number conversions weren't implemented. This patch implements
string-to-number and string-to-boolean conversions.

https://bugzilla.gnome.org/show_bug.cgi?id=707382
tests/gvariant: Use G_N_ELEMENTS

Instead of sizeof(array)/sizeof(type).