Escape quotes in json files and add micro optimization in for loop

Closes #9.