Build class definitions for models