An all-optical biological function generator and oscilloscope framework for characterizing gene circuit dynamics