refactored database abstraction
clean up and change over to promises
moving search indexing around