Copy readMaybe/readEither from base >= 4.7 for backwards compatibility
Add license headers for code copied from Cabal