Changes to work with the new EMS.

Also removes some unnecessary files.