Implement the new spec for typed object

This covers primitive types, ArrayType, StructType and some of the metadata.
TODO:
1. Handles
2. pointer/stirng/any
3. more metadata
4. WebGL examples