Copied all core libraries from HcBackend, prepare to refactor HcBackend.