Moved code for statistics and distributions to the SqlTable.
Improved documentation.