saving history json file; reformatting secrets; adding plaintext template