Add ability to change mode on  (inbound/outbound)
Reorganize tests