Latest changes rollup

EMDR code almost ready.
Database is in process of being refactored.