Tunable Magnetic and Electronic Properties of the 2D CoO2 Layer