refs #57 some code improvements and tests, also some adjustments for sites having not many visits