Update icePort.java

i've reorganized 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 now, so 'im going to bed :)