Optical modulators with 2D layered materials