sbinary formats for generated API classes.

Currently these are hand-coded. We might want to replace these with
generated ones in the future, although that might not be easy/worth it.