Custom encodings

As concluded in #2, it'll be nice to be able to inject custom encoding, and therefore be able to support more than just JSON.

Also, changing the server to take an options-object (as the client already does), so this will be 3.0.0