Started work on serialization.
Minor useful changes in Variable class