JS fixes

Cleanup and support for multiple widget instances on the same page