Config refactor, and starting to add JSDoc everywhere.