Bugfix, improvements and comments

Fixed a bug about purge ;)
Improved "day change" detection to go only "forward" not
backward, as in case of async even processing and at midnight
this would introduce "oscillations" in partition creation. now
the part is only switched once.
Added some explanation to purge related to KZ
Added UT for partitioning by day