Templatise type representation

This is to support both heap- and zone-allocated types in the future (the latter not yet implemented).

Also, handlify the type API some more.

R=titzer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/107933005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@18521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00