Fix errors caused by undefined and text nodes

- Ignore undefined nodes
- Don't try to set the parent for undefined or string nodes
Bump the version to 0.1.7
Merge pull request #2 from awieland/master

Handle undefined elements