Js cleanup

Mergable pull request for some JS cleanup and better shutdown / reboot pages.