Reorganize and clean up

This moves the viewer-related stuff into its own dir and cleans a few things up.