Chlorinated graphene and graphene nanoribbons: A density functional theory study