functions: Add websocketcommand

And make use of it in crouton* scripts.