Fixed various instantiation Bugs, Implemented appendChild on top of that.

Hi Craig,
thanks for your initial gumbo binding. I tried to implement appendChild and found some bugs regarding "instances" of Node / Element and so on. In the upstream version they all share the same attributes and childNodes tables which leads to infinite recursion when creating a new element and inserting it (because this implicitly creates a self-reference). After fixing that and adding some tests to the test suites I implemented a first version of appendChild on top of that.
Checked with lua and luajit.
Please review and pull if you find the additions appropriate.
I added the `length` field in 318269c6f52030fced2997153db3d8abca5ad13b just as a small optimization to avoid the `O(log n)` complexity of the length operator. I'd prefer to keep this, unless there really is something "spurious" about it?