Signs and verifies frames. For now this is done on every frame. This is not the long-term goal and there needs to be a better strategy.
and make them a bit more concise. No functional changes
Both for just encode function as well as an end-to-end test.