Add commands module and other minor fixes on elasticsearch backend.