Moved most things into a class, and taken the names of the elements into
variables.