Addsource jsonrpc

Took out the addsource jsonrpc from the headless addition. @Montellese to review
This code is taken from our sources addition, its freaking ugly and yeah I agree it should probably be fixed for all protocols everywere :) I was just to lazy to do it :P