I'm still terrible at JavaScript but this is a slightly better sample

Sample now allows you to send stuff and disconnect and shit.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>