Cleans up code for blocks.

Adds JS constructor for block objects, which now
inherit from GraceObject.
The boilerplate methods for blocks are moved to the JS
prototype, while the “real” and “pattern” properties continue
to be custom-compiled for each block.

Also adds names to some type methods in the library, to
aid in JS debugging, and improves an error message.

Inter-alia, adds some public declarations to tests.