dehop: Move dehop functions out of Controller, fix a bug

Put the dehop-specific function definitions in the dehop module rather
than the controller. In the process, fix a bug where the code was
checking that the switch header was equal to a port. Use `InPort`
instead.

Conflicts:
	lib/Controller.ml