Declare language extensions locally via `{-# LANGUAGE #-}`s

This recommended practice since Haskell2010.
Modernize `terminfo.cabal` to `cabal-version: >=1.10` format

This makes `terminfo` dependent on a compiler supporting
Haskell2010 (e.g. GHC 7.0.1 or later). Supporting & testing GHC versions
prior to 7.x is rather tedious.