Changed indexdb to be one file and bug fix

Index db in 1 file is neater.