A theoretical study of the structure and reactivity of carbon and graphite layers on nickel surfaces