Fix some warnings
Fail on failure
Fix indentation
Fix indentation
Use the JSON module

For some reason JSON::XS doesn't work since the last Perl packages
update.  Should investigate.
Cleanup
Fix handling of IPC::Run::run exit status

Turns out that the exit status is returned in $?, not as the return
value of run().  So our error checking was completely bogus.