Give cfn a separate Template class

Change-Id: Iddeeef7e0303fcbf09fc936a96ec68dbccd5489e
Calculate template version only once

Make the template version an attribute rather than a method, so we don't
have to repeatedly recalculate it.

Change-Id: I65392d83aa931eb1fd9998664ad77d0c6fa5eb97
Merge "Give cfn a separate Template class"
Merge "Calculate template version only once"