Fix jsonmodels example to install like other examples.

Change-Id: Iaf1e570b497863936eb25abf289e04c3f70dc365
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Fix memory leaks and other related issues.

Change-Id: I7fc9b0592beabc0b0e225bf1f161bdbeaa9dba00
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>