Recurrent Layer implementation.