Merging into main.
Updated TODOs.
Standardized writer interface.