Store docs as JSON strings in memory.
Keep track of known terms.
Skip expensive merge operations if current state is null.
Update s3 api for packed json docs.