Added to_csv method to model

[#251]