Add websocket error codes

* Fixed server-side issue with the 'ws' node package by sending
  a 'normal' close code when disconnecting.