Implement caching of resource attributes

The default caching mode cache_local will return the previously
resolved value if it is available.

Whenever any resource changes state, all resource attribute caches
are cleared just in case the state change has side-effects in
other resources.

The caching mode cache_none performs no caching, and is chosen
for attributes which are one of the following:
* Derived from any resource's metadata, resource data or resource_id
* An API call which returns a secret

Caching currently only exists for the duration of the parser.Stack
object, but there is future potential for a caching mode which
caches attributes spanning multiple requests.

Closes-Bug: #1321970

Change-Id: I01bf2983b726f0e81a2b8d5be94627353bdeb406
Merge "Implement caching of resource attributes"