near-final commit, updated to use exec_command and better error handling in scripts.