Autogenerate builtin types/commands.

* Added builtin.json for builtin types.
* Moved templates to py/templates
* Added some new templates, only for builtin types:
  * builtin.js
  * type.{h,c}
  * commands.c
* Fixed bugs in commands.py/helper.py now that more types are being
  used.
* Added builtin_funcs.{c,h}; these use to be directly in commands.c, but
  it is harder to do that when autogenerating.
Add comparison functions: lt, lte, gt, gte, eq, ne

Also, use macros for many builtin_funcs to reduce code size.