Move statistics to libutils