Testing hypotheses on genetic variation and population structure: a general framework based on exact tests and combined p-values