Split functionality out into submodules.

We do not always need all functionality of this module. This decouple
this into submodules.