Modularlize

Moved METS writing code into its own module class, and generalized the
export controller and viewer.