data: add two methods

1) lowestByDate(date, days) returns the 'lowest' in $days before $date.
2) highestByDate(date, days) return the 'highest' in $days before $date.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
test: add tests for data module

Add tests for both lowestByDate () and highestByDate().

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>