建立lib目录，分离出基础设施代码

Signed-off-by: hurley25 <liuhuan1992@gmail.com>