Moved process management into its own file.