Minor update to switches function

Moved switches[] to parse[switches] as it reuses a lot of similar code.

Also added the ability to parse --VARIABLE and -VARIABLE VALUE switches.

Moved route[ports] into correct alphabetical order.