Move metainfo types to 'Types.hs'.
Extract peer connection into function.