the first working version

* fix several tiny bugs
* add a set of tools for build png files from tpl files.