Fabrication of nanostructures and nanoscale devices