Added reading and writing files for jsonencoder

Also did some code cleaning for efficiencyhistogram
Forgot to commit this

Necessary for jsonencoder to import efficiencyhistory