Fetch RawTemplate from Stack, not a query

This will allow a future optimisation to prefetch Stack.raw_template
in a single query.

Change-Id: I24a64d6159342b3232667e499808dc0233c83e1f