Molecular functionality in nanoelectronic devices