investigation.py: generate json results file

TODO: Encodings not correct. This is evident in the first row of
results.txt. Fix this.