Cleaned up code and comments, added javasript for menus