More SQL for calculating statistics.
Refs #1733
Initial SQL to calculate statistics.
Restructure repository to make pithos one package.
Refs #1735