extract the database from eba

EBA now takes the database as functor parameter, only some
functions are needed.
The dabatase will be generated using distillery templates.
Many parts of EBA have been commented during this big change. They
will be re-usable later (we need to know what should be generated
and what should act as a library).