refactoring more gladbooks-specific functions out of gladd.js