RPC Token support.

Somewhat unpolished right now, but works once set up.

I suggest you send some time polishing this if you merge, at the very least the way errors are communicated to the user (right now the user is essentially *spammed* with error messages when there is no token or the token is rejected). Also, the websocket right now still says "success", even when the token is incorrect.

Anyway, in the long term it might be better to refactor the RPC code properly.

Would fix issue #80.