Molecular memory transistor