Refactored server.js to launch functions based on arguments run via command line