ClientResourceRegister is refactored.
Merge with 'master' branch