Implemented PortIn, PortOut and PortInOut API #8

Followingt test cases have been passed:
* PortOut (#24)
* PortOut PortIn (#9)
* PortInOut (#8)