Extract maybe re-hash/re-search and insert logic into a new template.
Use this new template to do impl templates for all three put forms
(which required renaming a couple 'value' arguments to 'val').
Added OrderedTable and OrderedTableRef versions of both as well.