Cleaning, commenting, Firefoxing

Cleaned the code up a bit, added support for Firefox Nightly, and
commented some things so that I can remember what they do.