support map and array for xtemplate. Fixes #614