Add Functor and Applicative instances for GHC 7.10 compatibility

Builds with GHC 7.8 and with GHC HEAD.