Added embedded ES. Refactoring. Added tests.
Moved test
Cleaning up