Refactor selecting values from an attribute

Move the code to select particular keys/indices from an attribute value out
of the get_attr intrinsic functions and into the attributes module as a
separate function.

Change-Id: I16135159027cc52e8da74a4b5863fc8a8595d582
Convert AWS::EC2::Subnet to use attributes Schema

Change-Id: I0f7b6beef1023875ae499ce7ec06f4211c6c028b
Merge "Refactor selecting values from an attribute"
Merge "Convert AWS::EC2::Subnet to use attributes Schema"