Refactor proxy-enabled payload handling

This fixes a couple bugs and generally cleans up the proxy option parsing code. 
Its not clear if ```[]``` would work here, still has to be reviewed.