Added sopport for automatic indicies.
Changed testing to use mocha framework.

Now it is prettier and we can test in browsers.