convert type and data and newtype declarations to fragments closes #9