Refactor broker into publisher and subscriber

Since a socket can be connected to multiple subscribers, this function should return a vector of URIs.