Estimating relationships and relatedness from dense genome-wide data