Silicon micromachined periodic structures: from photonic to optofluidic applications