Refactor LSTM as a mixin.