ok, I just pushed the merged code + export now overwrites the calibre plugin json. It should work as intended, but the calibre kindle plugin integration wasn't tested with an independent json file (I did an export then import).
About the wrapper: I was just wondering why it was needed instead of try/except, and thought it was about the kh_msg part for some reason (well, mainly because I didn't look at that part)