common: enhance heap function

Signed-off-by: Yibo Cai <cyb70289@gmail.com>
tests: add heap test code

Use min-heap to merge k sorted lists in O(n*logk) time.

Signed-off-by: Yibo Cai <cyb70289@gmail.com>
refactor object oriented design

Signed-off-by: Yibo Cai <cyb70289@gmail.com>