Continue working on new branch. Now fixing problems on Units. Need test.

I still need to deal with problem with file path caching like the one used by template. It waste a lot of space in state cache, i may need to fix it.

And also, after refactor the framework, it more slower than before, could be the Disk IO problem.