Refactor main switch into separate methods
Fix median vs. mean in documentation
Add option for quantity to be computed
Use option parser in main method