Break out free-standing functions in index.js into their own modules