Clear out all old-style actions and logic. Move tanh function to top.