Remove globals for root directory and URL
Refactoring to add --mode