modified to wrap multiple files and run from CLI
reorganized JS files into modules