Implement a maximum size for bucket identifiers

After a discussion with @jtuple, he pointed out that there's a limit on key
length but not on bucket length. We realised that someday, someone will abuse
this possibility, so I decided to code up a fix.

I have no idea how many of our current customers will be affected. Hopefully not very many.