Refactor project.js to use waterfall and move helper functions into gitty lib