Improved how widget IDs are generated on the server and client