Create generic typing infrastructure for building blocks
Our typing infrastructure is in bad shape, with every implementation of a building block having its own create/destroy, and no proper memory management of the contiguous layout we try to enforce for struct allocation.
We should try to work out a generic type mechanism that allows us to:
- keep allocating building blocks in users' stack
- allow new structs to be defined in users' code
- perform some amount of typechecks in create/destroy and dispatch code
- streamlines the headers and struct init code across the codebase.