Cleaned up code a bit.

Added some comments and renamed the form, buttons and subs to be a
little more explicit.