Tuning Chemical And Optical Properties Of Nanomaterials: From Extended Surfaces To Finite Nanoclusters