Feature/deletion check refactor

This includes the results of some refactoring work for the deletion utility. 
Primary behavioural change is modification of the (sigh) generated model classes to allow optimistic locking and the hooking of the deletion utility into that.