Also adds new logic to preserve the JSON representation of unknown operations, to protect from version downgrading or removal of extensions. Closes #1990.