Command to recreate per lane bam from a merged bam

Refer to AT-658, this command tool is needed to recreate per lane bam from a merged bam. The steps involved are: extract read group bam, compare flagstat, revert markdup tag, reheader bam, create bam index, create bam md5, move outputs over.
I'm somewhat wary of having default versions of things specified if this is going to be used in a pipeline. However, it appears to me that this command is unlikely to be part of a pipeline. If that's the case, you can disregard this comment!