cleaning up register code; comments from spec and gofmt
more spec comments and gofmt