Template: go back to previous data_set implementation, use different dict for local data

This fixes an unknown and random crash. Templates should use local_data map now.