Support for tags (also rewrote the test suite and increased test coverage)