History now works over the correct range.
	Before, we were using the keys of the adherance table, but once we
	optimize for fewer queries, this wont corespond to the right history
	range anymore. So, instead, I'm iterating over the range (today-30,today].