Add a database library like [the cpp one](https://github.com/EOSIO/eos/blob/master/contracts/eosiolib/multi_index.hpp).