refactor template dao tests, move helpers into common unit
add missing transaction test on template dao
delete private template after deleting a user
Merge branch '4951_delete_private_template'