Data types

This pulls the data-related types out of types.hpp and gives them nice homes. It also introduces build_data, an efficient, easy-to-use way to serialze fixed data structures.