setup test env
add Makefile, and let it to deal with test
refector code