check against element
remove unnecessaries
add ci config
add more tests
fix pattern.js according to latest test result