Write more unit tests; add helper functions for serialization in ConstraintModel & DeckModel