Export functions for extracting exported declarations

Move functions for extracting exported declarations out of psc-docs and
into Language.PureScript so that they may be used in other programs,
such as Pursuit.

Refs purescript/pursuit#1