change the sat encoder to be the same callback-based interface as the decoder, and update the test