Create engine.py

Added ElasticSearch connection logic, querying by models, and creating ES indices.