customizations to mongoose.js & railway.js (now compound.js)