fix bugs in ktable

- added the total number of bytes used to the number of bytes used each
  iteration of count_columns, which meant the number of colunms was
  underestimated. confirmed to work properly now with 480 cols.
- small code tidying  elsewhere
add breaks in switch statements

Learn to fucking code in C. really.
add tableDist - calc distance matrix iteratively

- Add code in dist.c
- add to Cmake lists