NICAR tutorial on transforming complex, linear scripts into a modular, easier-to-maintain package.