Add assert checking struct size and field offset.

Also fix a couple bugs as a result.
Move example ninja rules to their own files
Add support for subfields of a struct type.

Now you if have a struct:

struct A {
  int a;
};

struct B {
  A b;
}

You can access it in JavaScript:

    module.types.B.fields.b.fields.a

with the proper offset.

It's verbose, but necessary to keep proper namespacing of field names.