Refactor: use promises in styleguide.js, use named functions instead of comments, general readability improvements