Add support for resource attributes

Add support for specifying resource sttributes (DependsOn,
DeletionPolicy and Metadata). Also add a Name helper function to
pull out the name from an object for use with the resource attributes.