Implement to_dict() method for Resource

 + ClusterTemplate now have node_groups as list of NodeGroup objects

Change-Id: Icabea563bdadd2056181e827ed8942a90ca4bc15