Modularize the core

Turn this into a module that can be imported
via require, and serve as the core of a
separate backup module.

Removes the 'nconf' dependency.