Refactor to prepare for emitter.
Add Y4M emitter.