Rough finish to EA encoding

Roughly finished up EA encoding.
EA encoding needs a lot of work still but *should* be in a functional
state.