add dojo 1.9.0 compatibility
work on template sys
refactor flow model