Role Of Surfaces And Dopants In Quantum Devices And Nanowire Transistors