Rough outline of loop for execution of modules on targets in the database