Update icePort.java

i've reorganize a little bit the code (i've added a class to handle the performed actions when a listener is activated), and i've added some code about state fetching.
There are still mistakes, but i'm a little bit tired so i'm going to bed now :)