code for annotating and extracting contigs with median count info

@mr-c I think these should be merged because it's merely changes to sandbox.