Added flattenTriangular function and test

Using count makes it sound more important than it is, s/count/k/g