implement switch support

I took a crack at implementing switch support. 

Note that i did not update the minified merged version with acorn as there's no indication in the repo how this is being done.