added support for self-closing tags, closes #10