Complete rewrite of stream handlers and judges fixes #20 and implements #19