Initial production-ready release

Added in-script documentation to all functions.