Replaced collections index and chooser with orm
Made most functions work with database storage