Update API to match spec.

* rename types
* add missing types
* generate errors when accessing internal constructors
Merge pull request #153 from dstockwell/spec-update

Update API to match spec