Added rule tests
clean up of  action definition and management code