Extract index to own module + fix jshint-warnings