Optical and transport properties of ultrathin NbN films and nanostructures