Fix for #16: $ele changed to $node.

Thanks to @MrElectronic for catching this one.
For #16, removed extra wr(' ') from PI serializer.

This caused a trailing whitespace after the PI contents and before
the PI closing tag.
Fixed the logic for search for a close-instruction (#16).

Again, thanks to @MrElectronic.