Add todict method on models to make serialization easy