Core WebSocket provider

Sorry for the messy pull request. I had to merge into master to fix some things.

Fixes #12