Tunable Optical Nonlinearities in Layered Materials