widgets: set widget ptr as JS object private data
widgets/volume: implement active switch functionality

Should probably move the initialization code to a separate function to
avoid repeating this code for every static JS function.