add main-is to allow building through setup.hs
factor out type definitions into separate file