Start extracting subroutines to module.  Not compiling yet.