Carp  fix queues and tests

A bunch of fixes on switch.py, based on the stuff to do on google docs and whatnot.

Includes stuff from flow_table.py