Simplify command line and options processing.

Remove some special case flag processing and rely on commander.js more.
Move referrer option from System to options.js.
This seems irrelevant to this change. Maybe extract this into a different patch and add a test?