Simplified event messaging

Added a new function in Player that manages all api calls with or
without data. Removed individual event functions in api and implemented
one general function that handles all events.
Debug function

Added debug function to log from Flash to Javascript console.