encode the entire model when rendered into page (and decode it to read the json)