Add socket broker and support PHP API

Also allow reset device on the fly.