Molecular basis of NMDA receptor functional diversity