Algorithms For Scalable And Efficient Population Genomics And Metagenomics