write-commands: add write commands module for more code sharing.