Minor improvements on model code generation and copy operations. Removed
unecessary use of std::vector to acess std::map elements in ordered way.