Added support for custom tags, added unit tests.