Fix initialization order error.

Template cache system shouldn't init in init() function, since user may
register template functions on it.
Merge branch 'dev'