generate.py: crude tweaks to allow structs and typedefs

This might close #2, but generate.py feels very brittle and will probably break again in the future.

Signed-off-by: bryan newbold <bnewbold@twinleaf.com>