Sort out event handlers for sliding menu

Instead of tracking the open state of the menu,
use the "slide" class to determine whether the
menu is open or not at the moment.

And switch to one-time-only handlers to open/close
the menu each time it is clicked.

In addition, use setTimeout() to ensure that
all layout operations for hidden elements are
completed before attempting to show the home page
and close the menu.

This fixes a bug with the menu where it would occasionally not
hide elements correctly, leaving the app broken (no menu button
to get back to the home page, and the menu itself unresponsive
to clicks).