WIP Implement proper partitioning by day and purge

As part of related work on NX-459. Since master Timeline had some unfinished work regarding partitioning/purge it seems.