add smoke test shell script, change preprocessor and processor to use Document, refator some naming