Scalable Algorithms For Genetic Association Studies, Genotype Imputation, And Ancestry Inference