go.talks: refactor Playground JavaScript API

These changes will be propagated to the go-tour, go-playground, and go core.

R=dsymonds
CC=golang-dev
https://golang.org/cl/10868045
6 files changed