initial import factorization tools

accs not really an accumulator since this is symmetric but this is minor, (x, y) would be equally good or better naming imho