Move HTTP handling out of cmd/gopkg