Moving the declarations inside the constructor function so that they are not globally scoped.
Allowing index to be exported.