Fix: Deleting a Term does not delete associated records

Closes #484
Adding docblock and amend tests

Updated test as per #483
Various CS fixes

- Add missing space
- Remove extra space
- Indentation fixes
CS Fixes: Templates
Merge branch '1.5-cs-fixes'