Add rebase related functions

Signed-off-by: Shawn Bow <shawnbow81@qq.com>
improve rebase.py tool

Signed-off-by: Shawn Bao <zhenbao@marvell.com>