Store previous timestamp and item interval in JSON

Playing around with different sorting algorithms. These might be
useful (especially item interval).
Handle string timestamp in seconds_since