switch to using modules for copy_diff and cli interface
pull out input and output streams to cli level
Merge branch 'cli'