Upgrade switch 2

This unifies software datapath improvements from the debugger branch with betta.
It actually removes the old software switch first and rebuilds it from scratch commit by commit.
Some commits have been altered slightly to get them to apply cleanly.