Add PPM and manual gain control. Extract functions that create/resize/close windows to a separate JS file.