Refactor eachSchema function so it can be used elsewhere

This takes a mongoose instance and a callback and yields each of the
schemas from collections.js to the callback.