Optimize for doxygen, no functional changes, which forced me to document
mainloop().

Synchronize some function names while here.
Add a Doxygen file to generate HTML output this project. Also works with Doxygen 1.8.7