Refactor frame writing in prep for the write scheduler and client support.