Changes mainly to improve integration with ECCS plus some cosmetics on the entities database interface