Added dimensions to state variable objects and all xml writer methods

This is the code to add dimension (write) support to state variables, parameters and analog ports. I haven't written the unit tests yet because I wasn't sure what you are after. What kind of things should I be testing?