refs #14. fixed some bugs.
refs #14. fixed some bugs, add some new feature. (c_app, sync process when the app is on).
Merge pull request #16 from jcrom/master

merge with trunk