Refactor application into class

Prior to this commit, nothing in the application was extracted
out into methods. Now everything has been extracted into functionality
so that an instance of this class can be created and used.