API: Added support for user-defined event listeners, some getters, and debugging functionality.

## Added functions:

### [string, int] IIC.addEventListener(string event, function(object data) listener)

Sets a handler for a given event. Returns the handler's identifier.

### boolean IIC.removeEventListener([ string, int ] listenerId)

Removes an event handler with a given identifier. Returns `true` if the listener was successfully removed.

----

### string IIC.getId()

Returns your id.

### string[] IIC.getConnectedIds()

Returns ids of all connected users.

### boolean IIC.isConnected(string userId)

Returns true if a user with given id is still connected.

### [ string, int ] IIC.onConnection(function(string userId) listener)

Sets a new connection handler and returns its identifier.

----

### [ string, int ] IIC.onChat(function(string userId, string name, string message) listener)

Sets a chat message handler and returns its identifier.

----

### string | null IIC.getCountry([ string userId ])

Returns the current country, or that of another user if his id is provided. If the user is disconnected, returns null.

----

### int getFlagWidth(string countryCode)

Returns the width of a flag of a given country.

### int getFlagHeight(string countryCode)

Returns the height of a flag of a given country.

----

### { int x, int y } | null IIC.getPosition([ string userId ])

Returns the current position, or that of another user if his id is provided. If the flag does not exist, returns null.

### [ string, int ] IIC.onMovement(function(string userId, int newX, int newY) listener)

Sets a flag movement handler and returns its identifier.

----

### [ string, int ] IIC.onRotation(function(string userId, float newAngle) listener)

Sets a flag rotation handler and returns its identifier. The handler will receive an angle in radians.

----

### [ string, int ] IIC.onWave(function(string userId, int waveX, int waveY) listener)

Sets a wave (left mouse click) handler and returns its identifier.

### [ string, int ] IIC.onGhost(function(string userId, int ghostX, int ghostY) listener)

Sets a ghost (right mouse click) handler and returns its identifier.

----

### int debugPoint(int x, int y, string color)

Draws a point for debugging purposes and returns its id.

### int debugLine(int x1, int y1, int x2, int y2, string color)

Draws a line between two points for debugging purposes and returns its id.

### int debugRay(int x, int y, float length, float angle, string color)

Draws a ray for debugging purposes and returns its id. Angle must be in radians.

### int debugText(int x, int y, string text, string color)

Draws a string for debugging purposes and returns its id.

### int debugFlag(int x, int y, float a, string countryCode)

Draws a ghost flag for debugging purposes and returns its id. It will not be visible to other people.

### boolean debugErase(int elementId)

Erases a debugging mark with a specified id. Returns true if the mark was successfully erased.

### void debugEraseAll()

Erases all debugging marks.