Mesostructured materials for optical applications: from low-k dielectrics to sensors and lasers