Move testing code out of index.js.