Some cleanup to index.js - comments and fixies for setHitsPerPage function