Tidy code and use latest core library functionality.
Enable rate conversion when streaming from a repository.
Default is not to append a metadata channel; add '--debug' option.
Add '--debug' and '--replace' options; only set duration when we know it.