structured: extract REST components into a resourceRequest

Summary: Also fix some golint and go vet errors.

Test Plan: unit tests

Reviewers: petermattis

Reviewed By: petermattis

Subscribers: team

Differential Revision: http://phabricator.cockroachdb.org/D158