add jinja2 template engine and some other enhancement.