Nanoscale functionalisation and fabrication of optoelectronic devices employing two-dimensional materials