improved validation triggers
closed #2, and mostly separated DML from DDL