Cleanup template group (and other minor fixups)

This pr mostly removes the use of the deprecated `template_group` property in favour of setting the `group` inside `templates: {  }`

- Some Spices, (eg. Amazon, Airlines) were also not defined inside a closure so I fixed them accordingly
- Moved helper functions outside the scope of the callback
    - Used function declarations to define them so that they're hoisted
- Fixed indentation where necessary

cc// @russellholt @jagtalon @jdorweiler