fixing small bugs, adding a mechanism to run controller and switch on the same process, fixing the switch to work on macosx

A bunch of fixes on the openflow protocol, merging with the latest cstruct and a working example of a switch on macosx.