factored out ui code to make way for comments
added basic comment viewing support, fixes #7