Adding platform events

Sending some platform events, listening and processing the
PLATFORM_CLOSE event