Add traversal to scripts and refactor to use command line options