Ensure fields, methods and enumerants are sorted by id.
Add register_interface and some basic tests.