WIP: In index.js, use promises instead of callbacks