Added create index and test for it. Tweaked other methods and tests.