Added doc.
Moved gui code to the appgui file. Cleaned up html.