Break main script into modules. Introduce legacy (Hadoop 1.x) and docs directories.