Major rewrite of script
Major rewrite of script

Sorry for the mega-commit. This commit includes a number of smaller
changes:

1- Better documentation
2- Command line arguments can now be used to customize execution
3- New program flow. Elements are created and processed in a make-like
way, documents -> sampled documents -> sampled metadata
4-Metadata is now pulled from the main CN for now instead of the
authoritativeMN

NCEAS/metadig,NCEAS/metadig,NCEAS/metadig