Optical modulators with two-dimensional layered materials