Got rid of bodies of element handlers because they were distracting and
probably wrong. Wrote comments describing desired behavior of each
main handler function.