Crystal structure and electronic properties of wurtzite MgxZn1-xO: Ab initio study