Added comments & cleaned up code.

Added comments.
Renamed some functions, vars, and CSS to make things easier to
understand.