add a configurable constant MAX_TAG_BUFFER_CAPACITY 

The current threshold `Constants.DEFAULT_TAG_BUFFER_SIZE = 512` used with `LIMIT_BUFFER` is both not configurable and too small - almost any non-trivial tag will have an output larger than 512 bytes, which means using the `LIMIT_BUFFER` will end up generating lots of garbage.

This patch adds a configurable constant `MAX_TAG_BUFFER_CAPACITY` to control the threshold for clearing the buffer. The default value is 32k, but I would not mind changing it to 512 if backward compatibility is important here.