Clean up and migrate declarative JSON code

This is based on work I did for a PriceCharting scraper.  I've cleaned
up the implementation and added support for library(http/json) terms.
This does not include any of the partial JavaScript Object unification
code we use in the scraper.  I plan to import that later.

This code has a long way to go before it's fully compliant with the JSON
spec, but it works for some rudimentary, shallow JSON values.
Add documentation

While writing the documentation, I realized some warts in the API which
I corrected at the same time.