Added ability for custom protocol passing, changes api

Hi, I've been hacking on restream, there are a few changes here, they're documented in the code.