Use a thread for parsing JSON

This fixes issue #120