Completed delete functionality. Now also deletes connections between tables when record is deleted.