State machine / progress page

This is essentially a rewrite to a state machine.

Goals:
* [x] Answer HTTP requests while opening the window
* [x] hitting "close" while it's opening the window aborts the open and starts closing
* [x] add a JSON status page with
   * [x] open/close status
   * [x] remaining time, when opening
   * [x] current open percentage/time
* [x] add JS so that there's a progress bar with the info from above status page
* [x] get the new index page to work