Make random generator static instead of global.

Just better practice. Also remove some stray whitespace and add a
header for directory traversal since git add -p was being a pain.
Implement patch directory traversal and skeleton for processing files.
Remove unused concat_patch function.