Split script into modules

Split the massive single R scripts into multiple files each containing
related scripts.