Added row and column options to tables.pl and made removing duplicates O(n ln(n)) instead of O(N^2)