Fix ambiquity due to generalised `elem`

In base-4.8, `elem` has been generalised to `Foldable`, so in
combination with `-XOverloadedStrings`, something like `\c -> elem c
"abc"` can't be type-inferred anymore.

(cherry picked from commit a9cb42103d38df03466497b1b2974f7589eda327)
Enable `FlexibleContexts` for GHC 7.10 compat

For more details, see

 http://permalink.gmane.org/gmane.comp.lang.haskell.glasgow.user/24612
Accept time-1.5 for GHC 7.10 compat