Allow hyphens in complex variables

Primarily to support ${hostvars.hostname-with-hyphens.<var>}.