start to generalise form arguments passed through to renderer
remove more duplication
move arg dict where it can be reused
manual merge
Merge commit '4cd4' into try-merge-latest-import-code