Reduce visibility of struct-related bits

Struct handling is now mostly encapsulated within struct.c. There are
a couple of places where internal details leak out that need fixing.