Nightly polishing of switch

Moved to ESwitch
Added tests
Few tests still failing