Implement basic functionality

I don't have history previous to this. This implements
the basic functionality of switching between modes based
on the input from the one microswitch.